I love Apple, but they messed up big...

Thank you very much Shane !

All is working now … except the color Red! :slight_smile:
First the color change was not working at all, but good that you mentioned the caps is important.
My xcode has changes the redColor() to RedColor() automatically and after I tried blue all was ok.
No idea why this happen on my Mac.

With your examples it was even possible for me to change the size of the text box with the command:

tell textField to setFrameSize_({400, 50})

Now I am puzzeling how to find query other sizes like Text Box size.
Have tried with : set theTextboxSize to textField’s |FrameSize|()'s frame()

but no luck.

thank you again!
pppfff

This has to do with how the compiler saves variable names in AppleScript. Once you compile using one variable name,
all future names will be capitalized the same. Really irritating. I believe the reason it is done this way
is so once you have one variable name, you can type the next one in all lowercase and it will reformat it letting
you know that you spelled it correctly.

The way around this is to remove all instances of the specified name from the file. Save and close the
project. When you open it back up, insert the correct name and compile.

Cheers,

Craig

See above:

		set theFrame to textField's frame()

Or if you can’t be bothered, surround the name in pipes:

|redColor|

Sweet! Had not thought of that!

Shane,
I understand :slight_smile:

Being able to read can be an advantage!

Now I see the dimension of the text box. In the example below, I get two times the same results, even the size has been changed.
Is there a kind of update command I have to use?

best regards
pppfff

tell textField to setFrameSize_({200, 100})

	set {{x:x1, y:y1}, {width:theWidth2, height:theHeight2}} to theFrame as list
	display dialog theWidth2
	display dialog theHeight2
	
	delay 2
	
	tell textField to setFrameSize_({400, 100})
	
	
	set {{x:x1, y:y1}, {width:theWidth2, height:theHeight2}} to theFrame as list
	display dialog theWidth2
	display dialog theHeight2

PS: Thank you Craig for the hint with the pipe symbols !
Do not need to buy a puzzle game, have it all here :slight_smile:

You haven’t updated the value of theFrame – you need a " set theFrame to textField’s frame()" after you change it.

Shane,

thank you again. It is working ! :slight_smile:

Have added it before the “set {{x:x1 …” line

tell textField to setFrameSize_({200, 100})
set theFrame to textField’s frame()
set {{x:x1, y:y1}, {width:theWidth2, height:theHeight2}} to theFrame as list

Step by step I am learning, baby steps !

Is it ok to ask another question (or more :wink: ?

How can make the text field scrolling, if the content is too long ?
Or how can I make the font smaller if it is too long ?

best regards
pppfff

I would consider a text view.

As Richard said, you want an NSTextView rather than an NSTextField.

hmmh, two answers an I still have difficulties to find the right object. Sorry!
In the Library I am finding only TextView which is “NSTextView in an NSScrollView”, but it is not working for me.

Is there something I am overlooking ?

thank you
pppfff

Make sure you IB link goes to the top of the text view, there will be a thinner separate box at the top, this is the actual text view, the rest is a scroll view.

And as in my tutorial and other examples, the 2 key methods are |string|() and setString() rather than stringValue() and setStringValue()

wow, that was very quick!
And I see now the text. Great!
If the text is longer than the text box I am able to scroll.

It is not scrolling automatically from left to right.
I guess I have to show you what I want to do.
Will create some pictures and post it here.

Very very good forum here !

THANK YOU, Richard, Shane, Craig and all!
pppfff

Or a link to the zipped project folder, you have Mobile Me? Or any file sharing site.

Yes, I have MobileMe and I am just uploading a screenshot movie to demonstrate what the application is doing.
The movie is 36 MB and my upload speed is very very slow. It takes 20 minutes, could be even more and it is quite late here in Germany.
Tomorrow I will post the link to my public MobileMe folder.
Next step is then to upload the zipped project folder.
Sorry for the delay.
best regards
pppfff

OK,
here the link to the demonstration how the application is working:
Video

And inside the application I have written:

– Have used two Applescripts as “templates” to realize this application

– No 1
(*
Applescript Code for this Image View is mainly
from:
“Art to Desktop” for iTunes
written by Doug Adams
dougadams@mac.com
v2.1 sept 10 2009
– updated for Snow Leopard compatibility
– enhancements and finesses

(there are additions from myself, to view all images in the artist folder as well)
*)

–
– No 2
(*
db iTunes Fade-and-Advance
By David Battino, Batmosphere.com
Version 2009-03-03JJ
Based on ideas from Doug’s AppleScripts and Mac OS Hints

See [url=http://www.oreillynet.com/mac/blog/2007/03/itunes_fadeout_script.html]www.oreillynet.com/mac/blog/2007/03/itunes_fadeout_script.html[/url] for background

or 
http://broadcast.oreilly.com/2009/05/itunes-dj-applescript-fade-to.html

This script fades out iTunes if it's playing and then plays the next song.
If iTunes is paused, the script will start playback.
*)

(*
And here I have found very good tipps & tricks

Slider Control
Mouse Control
Color control

http://www.bynkii.com/archives/mac-os-x-scripts/2009/

Craig Williams has created 5 very good tutorial about the new Xcode Applescript

http://macscripter.net/viewforum.php?id=31

Infos about the Idle Function you will find here:
http://discussions.apple.com/thread....7699&tstart=45

And here the link where I have found how to display a picture:
http://macscripter.net/viewtopic.php?id=30462

The buttons have been designed and created by myself with Photoshop 6.0

*)

And again I have a question:
How is it posssible to this text in the ABOUT or HELP popup, to give credit to all who has helped?

best regards
pppfff

I don’t know how but you could too easily add a credits item to the app name menu with a window with a text view.

Hi Richard,
yes, that was my thought as well, but I wanted to have it “professional” :slight_smile:

Here the link to project source code.
Zipped Project Files

You need to have jpg or png pictures in the iTunes artist folder.
If it is a compilation then it is looking in the artist folder as well.
If you press the button “Open/create Artist folder …” then the finder is checking if such a folder exists.
If yes, it opens this folder. If no, it creates such a folder.
Then Safari is searching for the artist name in google pictures medium size.
Now you can open the full size picture and drag it to the artist folder.
Update: Goal is to automate that step. With a confirmation step to make sure the picture is the the right one.

The skip forward button with an S skips to the selected song in iTunes.
All the other buttons fade in and out to the next or previous song.

Have fun and please give feedback!

best regards
pppfff

Save the info in a file called Credits.html, Credits.rtf or Credits.rtfd, and add the file to your project. It will appear in the About box automatically.

Shane,
thank you ! After some trys and errors it worked.
Have created the file in pages and exported it in rtf format.
Then I dragged it into the project under “resources”.

:slight_smile:
pppfff