• 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 flaking out on simple tasks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UI Scripting flaking out on simple tasks


  • Subject: Re: UI Scripting flaking out on simple tasks
  • From: Bill Cheeseman <email@hidden>
  • Date: Wed, 31 Dec 2003 06:22:15 -0500

on 2003-12-30 7:10 PM, Henrik Boes at email@hidden wrote:

> I am trying (still) to get a handle on GUI scripting and am finding
> myself moving backwards, not forwards. Below is the simple script I'm
> testing:
>
> tell application "TextEdit" to activate
> tell application "System Events"
> if UI elements enabled then
> click menu item "New" of menu "File" of menu bar item "File" of menu
> bar 1 of application "TextEdit"
> else ....

You left out the required inner tell block. After activating TextEdit, you
must then tell application "System Events" to 'tell process "TextEdit"' to
do things. Notice that it is 'process "TextEdit"', not 'application
"TextEdit"', in the inner tell block. Like so (watch out for line wrap):

tell application "TextEdit" to activate
tell application "System Events"
if UI element enabled then
tell process "TextEdit"
click menu item "New" of menu "File" of menu bar item "File"
of menu bar 1
....

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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: 
 >UI Scripting flaking out on simple tasks (From: Henrik Boes <email@hidden>)

  • Prev by Date: stereo sound panel thanks Craig !
  • Next by Date: Re: getting the date
  • Previous by thread: Re: UI Scripting flaking out on simple tasks
  • Next by thread: Checking for logged on guests
  • Index(es):
    • Date
    • Thread