• 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: UI scripting question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UI scripting question


  • Subject: Re: UI scripting question
  • From: Jim Brandt <email@hidden>
  • Date: Fri, 18 Jul 2008 13:12:20 -0500

the error is:

System Events got an error:
NSReceiverEvaluationScriptError: 4

The same error I've gotten when I mistype an element name or 
or reference a nonexistent element or some other similar error.

Putting a delay in front of the "click button 2 ..." line didn't help.

Jim Brandt



I've tried this:


tell application "System Events"

tell process "Safari"

click menu item "New Window" of menu 1 of menu bar item "File" of

menu bar 1

delay 1

click menu item "Page SetupŠ" of menu 1 of menu bar item "File" of

menu bar 1

click button 2 of radio group of sheet 1 of front window

keystroke return

end tell

end tell


The page setup dialog comes up but it doesn't change to landscape mode.

if I use:

click button 2 of radio group 1 of sheet 1 of front window

I get a System Events error.


Am I just out of luck on this one?


What is the System Events error? If it's that a button with index 2 doesn't

exist, or words to that effect, then perhaps the Page Setup sheet hasn't had

time to come up. Try inserting 'delay 1' before the 'click button 2 ...'

statement.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Hiding a compiled script
  • Next by Date: Re: Anyone here using source control?
  • Previous by thread: Re: UI scripting question
  • Next by thread: Re: UI scripting question
  • Index(es):
    • Date
    • Thread