Applescript Studio Set Visible

Discussion in 'Mac Programming' started by vladimir929, Feb 21, 2009.

  1. macrumors newbie

    Joined:
    Oct 22, 2008
    #1
    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.
     

Share This Page