Re: GUI scripting for Illustrator: Trouble!
Re: GUI scripting for Illustrator: Trouble!
- Subject: Re: GUI scripting for Illustrator: Trouble!
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 07 Sep 2006 17:54:09 -0400
- Thread-topic: GUI scripting for Illustrator: Trouble!
on 2006-09-07 2:52 PM, email@hidden at email@hidden wrote:
> 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 don't have Illustrator here to test your script as written, but here are a
few things to try.
1. Place the 'activate' command in a separate 'tell' block or one-line
statement of its own.
2. Add an ".app" file extension to the 'tell application "Adobe
Illustrator"' command. If that doesn't work, add " CS2" to the end of the
application name.
3. Remove the ".app" extension from the 'tell process' command. If that
doesn't work, remove the " CS2" part of the process name, too. If that
doesn't work, remove "Adobe ", too. (In Adobe applications, the name of the
process is often different from the name of the application.)
4. Try either three periods or a single ellipsis character
(Option-semicolon) in the first 'click' command, or 'click menu item n'
where n is the index of the "Clean Up..." menu item in its menu.
5. Put a 'delay 1' or 'delay 2' command between the two 'click' commands to
give the Clean Up window time to open before clicking the OK button.
With respect to items 1, 2 and 3, above, I believe that PreFab UI Browser
would have told you to write the script differently than you wrote it.
Here's the UI Browser-generated short tell block wrapper for Adobe
Photoshop, for example:
activate application "Adobe Photoshop CS2.app"
tell application "System Events"
tell process "Photoshop"
-- GUI Scripting statements:
end tell
end tell
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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