Hi all -
A year or two ago I created a script to do some drawing adjustments and then export to several different file types that I needed. However, firing up the same script in CS2 results in the NSReceiverEvaluation error - “I can’t find what you’re looking for!” - wherever the script was meant to click on a menu, button or popup. (keystrokes still work lovely)
I’m using the code generated by Prefab’s UI browser targeted at Illustrator CS2 (which is still able to pull the menu information out of Illustrator) but it refuses to do it. I’ve not experienced this problem when UI scripting in other applications or with the CS version of Illustrator. I’ve migrated most of the script to alternate means but I can’t seem to get to everything. I know I could record an action, but I’d prefer this to not require any prior set up if it happens to be run on a different computer.
Has anyone else had this problem? Any solutions?
The code I’m testing with is (direct from UI browser - click selected element with safe tell wrapper):
activate application "Adobe Illustrator"
tell application "System Events"
get system attribute "sysv"
if result is greater than or equal to 4144 then -- Mac OS X 10.3.0
if UI elements enabled then
tell application process "Illustrator"
click menu item "Stroke Color" of menu 1 of menu item "Same" of menu "Select" of menu bar item "Select" of menu bar 1
end tell
else
beep
display dialog "GUI Scripting is not enabled" & return & return & "Open System Preferences and check Enable Access for Assistive Devices in the Universal Access preference pane, then run this script again." with icon stop
if button returned of result is "OK" then
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
end tell
end if
end if
else
beep
display dialog "This computer cannot run this script" & return & return & "The script uses GUI Scripting technology, which requires an upgrade to Mac OS X 10.3 Panther or newer." with icon caution buttons {"Quit"} default button "Quit"
end if
end tell
It always fails on the click line
Thanks!
Model: iMac G5
Browser: Firefox 1.0.7
Operating System: Mac OS X (10.3.9)