This has me stumped. I’m trying to create a script to change the “Color Settings” pref under the Edit menu in Illustrator CS. I found no direct way to do this in its Applescript dictionary so I’m trying GUI scripting. Here’s what I’ve got so far:
tell application "Illustrator CS" activate end tell tell application "System Events" tell application process "Illustrator CS" -- this part seem to work to bring up the Color Settings dialog tell menu bar 1 click menu item "Color Settings..." of menu "Edit" of menu bar item "Edit" end tell tell window "Color Settings" click pop up button 5 click menu item "U.S. Prepress Defaults" of menu 1 of pop up button 5 -- this "appears" to work looking at the screen but doesn't hold the setting select tell button "OK" click -- this doesn't work at all end tell end tell end tell end tell
The first part of the script to bring up the dialog works. Choosing the item from the pp up button appears to work, but the setting does not hold. The part to click “OK” and dismiss the dialog does nothing. If I manually click “OK” that’s when I find out that the choice on the pop up menu didn’t stick. If I reopen Color Settings manually, nothing has changed!
Any ideas? I’m new to GUI scripting…
Thanks in advance