Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

trainguy77

macrumors 68040
Original poster
Nov 13, 2003
3,567
1
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.

Code:
set alternateimage of button "play" of mainWindow of myApp to image "pauseclicked.tif"
Yet this line right above it works fine:
Code:
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

macrumors 68040
Original poster
Nov 13, 2003
3,567
1
any ideas? There must be someone who has written some applescript applications?
 

rob finch

macrumors member
Mar 24, 2006
93
0
England
trainguy77 said:
Code:
set alternateimage of button "play" of mainWindow of myApp [B]to image[/B] "pauseclicked.tif"
Yet this line right above it works fine:
Code:
set image of button "play" of mainWindow of myApp [B]to load image[/B] "pause.tif"
set image of button "play" of window "miniMainWindow" [B]to load image[/B] "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

macrumors 68040
Original poster
Nov 13, 2003
3,567
1
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.