• 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: Excel2004, System Events & NSReceiverEvaluationScriptError
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excel2004, System Events & NSReceiverEvaluationScriptError


  • Subject: Re: Excel2004, System Events & NSReceiverEvaluationScriptError
  • From: Bill Cheeseman <email@hidden>
  • Date: Thu, 16 Dec 2004 16:30:11 -0500

on 2004-12-16 11:16 AM, Larry McMunn at email@hidden wrote:

>    tell application "System Events"
>       tell process "Excel_2004"
>          keystroke "p" using command down
>          -- problem occurs at the next line
>          click button "Save As PDFŠ" of UI element 4 of window "Print"
>          keystroke "d" using command down
>          keystroke "My Desired Worksheet"
>          keystroke return
>       end tell
>    end tell

Larry,

Your script appears to be correct, but I can't make it work in Excel, either
-- even with lots of changes. I'm not sure what is going on.

When I use UI Browser to Perform the Press action on the PDF button, Excel
responds as expected. (To do this, you have to bring Excel to the front and
Command-click UI Browser's Perform button to keep UI Browser in the
background.)

Yet Excel does not respond to the GUI Scripting statement. This usually
means a bug in GUI Scripting, but I don't know why it would appear here and
not in the Print sheet of other applications.

In most applications, the Print window is a sheet. In TextEdit, for example,
this script works just fine:

activate application "TextEdit"
tell application "System Events"
    tell process "TextEdit"
        keystroke "p" using {command down}
        click button 2 of UI element 3 of sheet 1 of window 1
        keystroke "d" using command down
        keystroke "My Desired Worksheet"
        keystroke return
    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

References: 
 >Excel2004, System Events & NSReceiverEvaluationScriptError (From: Larry McMunn <email@hidden>)

  • Prev by Date: Re: NSCannotCreateScriptCommandError (10)
  • Next by Date: Re: Excel2004, System Events & NSReceiverEvaluationScriptError
  • Previous by thread: Re: Excel2004, System Events & NSReceiverEvaluationScriptError
  • Next by thread: Re: Excel2004, System Events & NSReceiverEvaluationScriptError
  • Index(es):
    • Date
    • Thread