Re: applescript and Preview
Re: applescript and Preview
- Subject: Re: applescript and Preview
- From: David Marshall <email@hidden>
- Date: Sun, 15 May 2005 20:54:03 -0400
On May 15, 2005, Hernan Ochoa wrote:
I'm tryng to script Preview, but for some reason, it is failing.
Here's the code:
tell application "System Events"
tell process "Preview"
tell menu bar 1
click menu item "save as..." of menu "file"
end tell
end tell
end tell
but I get the following error:
process "Preview"
"System Events got an error: NSReceiverEvaluationScriptError: 4"
Is there another way to do this?
Wow...GUI scripting certainly extends AppleScript's flakiness to new
dimensions! ;-)
I was able to make this work:
tell application "Preview" to activate
tell application "System Events"
tell process "Preview"
tell menu bar 1
click menu item 7 of menu "file"
end tell
end tell
end tell
Very odd, since I got the same error as you when I used "Save As..."
(After that, I tried "menu item 6", but that was the "Save" command; I
eventually figured out that the separator between "Open Recent" and
"Close" is menu item 4.) Perhaps the ellipses are the problem?
- - - - -
Dave
_______________________________________________
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