Simple Applescript Studio question...

phatcactus

The Ugly Organist
I have really no AppleScript experience, so I figure I should ask for some help before my head explodes. I'm trying to change the title of a menu item when a drawer opens.

Code:
on opened theObject
	if name of theObject = "theDrawer" then
		tell window "mainWindow" to set title of button "drawerButton" to "Hide Drawer"
		tell menu "mainMenu" to set title of menu item "drawerMenuItem" to "Hide Drawer"
	end if
end opened

The button changes just fine, but the menu item is giving me all kinds of problems. Could someone help me out with the right syntax? drawerMenuItem is in a menu called viewMenu, if that helps at all...
 
I've done some scripting, no Applescript studio though.

Still, taking a wild guess ...

If the menu is called "viewMenu" shouldn't the statement say:

tell menu "viewMenu" to set title of menu item "drawerMenuItem" to "Hide Drawer"

Just a thought. Like I say, haven't tried AS-Studio.
 
Back
Top