How can I determine if menu item is ticked?

G’day

I’ve searched the forums, but can’t find an answer.

In Illustrator, in the ‘View’ menu, several items can be ticked or unticked. I need to ensure the latter state.

I’ve tried the following script, but the term ‘state’ is not working, and I can’t find anything in the attributes that I can set.

Can anyone set me in the right direction please?

Regards,

Santa



tell application "System Events" to tell process "Adobe Illustrator"
	set frontmost to true -- activates Illustrator
	keystroke "a" using command down
	click menu item "Convert to CMYK" of menu 1 of menu item "Edit Colors" of menu 1 of menu bar item "Edit" of menu bar 1
	get attributes of menu item "Overprint Preview" of menu 1 of menu bar item "View" of menu bar 1
	
	set state of menu item "Overprint Preview" of menu 1 of menu bar item "View" of menu bar 1 to 0
	
end tell

It’s OK, 10 minutes after I posted I found the answer. Seems to be the way of things, waste 3 hours lokking, post a question, then immediately find the answer :stuck_out_tongue:



					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