PDA

View Full Version : Applescript application code not working




trainguy77
Jul 31, 2006, 04:25 PM
I am helping do some GUI changes to an application. I need to make the play/pause button change its alternate graphic depending if itunes is playing or paused. I have it so it changes it main image but not its alternate. This line seems to kill it.

set alternateimage of button "play" of mainWindow of myApp to image "pauseclicked.tif"
Yet this line right above it works fine:
set image of button "play" of mainWindow of myApp to load image "pause.tif"
set image of button "play" of window "miniMainWindow" to load image "pause.tif"

What is wrong with the first of those code sets? It compiles fine just hangs when it goes to run that line. I remove that first line and it runs fine, just without alternate icons.



trainguy77
Aug 2, 2006, 12:22 PM
any ideas? There must be someone who has written some applescript applications?

rob finch
Aug 5, 2006, 04:00 PM
set alternateimage of button "play" of mainWindow of myApp to image "pauseclicked.tif"
Yet this line right above it works fine:
set image of button "play" of mainWindow of myApp to load image "pause.tif"
set image of button "play" of window "miniMainWindow" to load image "pause.tif"

I'm not sure this will make a jot of difference, but the two lines differ in that the line that kills it does not have "to load image" but just "to image".

trainguy77
Aug 20, 2006, 11:21 PM
I got it working a day or two after the op. It does need load....i was just trying different things. It had to do with the image file.