• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GUI Scripting: accessing menus causes error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GUI Scripting: accessing menus causes error


  • Subject: Re: GUI Scripting: accessing menus causes error
  • From: Andrew Oliver <email@hidden>
  • Date: Sat, 21 Jun 2003 10:16:32 -0700

<rant>
Of course, this wouldn't be a problem at all if Apple had followed their own
guidelines and provided even the most basic AppleScript/AppleEvent support
in Preview.app.

Personally, if I needed an AppleScript-based method of opening a document
I'd use something like:

tell application "Almost any .app that isn't Apple's.app"
open file "path:to:some:file"
end tell

And not resort to some hack to select a menu.

While there are workarounds such as:

tell application "Finder"
open file "path:to:some:file" using "path:to:preview.app"
end tell

Or even:

do shell script "open -a preview /path/to/some/file"

There's still no excuse to not include such basic functionality in any
application.

Apple ought to be ashamed of themselves, but I doubt they care.

Andrew
:)

</rant>

On 6/20/03 2:20 PM, "Henrik Boes" <email@hidden> wrote:

> Hello,
>
> I am still trying to get at least a bit of a handle on GUI scripting
> and am running into the following error when accessing menus:
>
> System Events got an error:
> NSReceiverEvaluationScriptError: 4
>
> The script in question is the following:
>
> tell application "Preview"
> activate
> end tell
> delay 10
> tell application "System Events"
> tell process "Preview"
> click menu item "Open" of menu "File" of menu bar 1
> delay 1
> end tell
> end tell
>
> Thoughts?
>
> I am running Mac OS X 10.2.6.
>
> Henrik Boes
> _______________________________________________
> applescript-users mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/applescript-users
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >GUI Scripting: accessing menus causes error (From: Henrik Boes <email@hidden>)

  • Prev by Date: Re: Path To blessed items (OSX and OS9): Odd or Normal?
  • Next by Date: Re: Path To blessed items (OSX and OS9): Odd or Normal?
  • Previous by thread: Re: GUI Scripting: accessing menus causes error
  • Next by thread: Re: GUI Scripting: accessing menus causes error
  • Index(es):
    • Date
    • Thread