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

vladimir929

macrumors newbie
Original poster
Oct 22, 2008
12
0
Hi, I am trying to make an applescript studio program that displays a red light or a green light to show whether it is connected. The lights are NSImages, the only way so far I have been able to call them to disapear or appear is when the application is starting through awake from nib. No where else in the program can i call the NSImages or use set visible.

Example
Code:
on awake from nib theObject
	if the name of theObject = "ipodgreen" then
		set Ipod to false
		if (list disks) contains "IPOD" then set Ipod to true
		if Ipod is false then set visible of theObject to false
		if Ipod is true then set visible of theObject to true
		
	end if
	if the name of theObject = "ipodred" then
		set Ipod to false
		if (list disks) contains "IPOD" then set Ipod to true
		if Ipod is true then set visible of theObject to false
		if Ipod is false then set visible of theObject to true
end awake from nib

This is the only way I have gotten it working so far, I have tried calling the NSImages by the names i assigned them in interface builder but the only way i seem to be able to call them is through theObject. Thank You. So Much.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.