getting menu attributes under Snow Leopard proving to be a hassle

G’day scripters

I’ve got a script that worked under Leopard, but the two lines below no longer get the attributes of the menu item under Snow Leopard.

Anybody got any thoughts on what I might try?

Regards

Santa



tell application "System Events" to tell process "Adobe Illustrator"
set temp to attributes of menu item "Overprint Preview" of menu 1 of menu bar item "View" of menu bar 1
	display dialog temp as text --> nothing
	set temp to value of attribute "AXMenuItemMarkChar" of menu item "Overprint Preview" of menu 1 of menu bar item "View" of menu bar 1
	
	if temp ≠ "" then click menu item "Overprint Preview" of menu 1 of menu bar item "View" of menu bar 1
end tell

G’day

Fixed! Turns out that the routine WAS picking up and returning the tick mark.

What it wasn’t doing, that it did before, was to return a null string “” when the tick mark was absent. So, I’ve had to alter the routine.


set temp to value of attribute "AXMenuItemMarkChar" of menu item "Overprint Preview" of menu 1 of menu bar item "View" of menu bar 1
	try
		if temp = "✓" then
			set frontmost to true -- activates Illustrator
			click menu item "Overprint Preview" of menu 1 of menu bar item "View" of menu bar 1
		end if
	end try