GUI scripting for Illustrator: Trouble!
GUI scripting for Illustrator: Trouble!
- Subject: GUI scripting for Illustrator: Trouble!
- From: email@hidden
- Date: Thu, 07 Sep 2006 14:52:50 -0400
Hi all...
I have been working with AppleScript for sometime now... but am new to
the concept of GUI scripting.
I have used the PreFab UI browser and come up with the following
snippet:
tell application "Adobe Illustrator"
activate
tell application "System Events"
tell process "Adobe Illustrator CS2.app"
click menu item "Clean Up..." of menu 1 of menu item "Path" of
menu 1 of menu bar item "Object" of menu bar 1
click button "OK" of window "Clean Up"
end tell
end tell
end tell
I get the error message "System Events got an error:
NSReceiverEvaluationScriptError: 4" when the script gets to teh "click
menu item..." line.
I already have checked the "Enable access for assistive devices" in the
Universal Access Pane of System Preferences.
The only work-around that I have found that will work is to use the
following snippet instead:
tell application "Adobe Illustrator"
activate
tell application "System Events"
tell process "Adobe Illustrator CS2.app"
keystroke "u" using command down
key code 36
end tell
end tell
end tell
This is all dependent on having set up the key command of Cmmd-u for
the Clean up menu item in Illustrator ahead of time. (Key code 36 is
the enter key that takes care of the "OK" button in the clean up
window.)
I'd really rather not leave this as the fix, since other co-workers
will need to use this script too and they will also have to set up the
keystroke in Illustrator for the scrip to run properly.
I'd appreciate any thoughts and/or help as all of the forums I have
searched do not seem to be of any help. They just refer to the Enabling
access as the fix for that particular error message. And since I have
already enabled my access, this can't be the problem.
Thanks in advance,
Jennie :)
________________________________________________________________________
Check out AOL.com today. Breaking news, video search, pictures, email
and IM. All on demand. Always Free.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden