• 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
Correct syntax for GUI Scripting 'click at' command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Correct syntax for GUI Scripting 'click at' command


  • Subject: Correct syntax for GUI Scripting 'click at' command
  • From: Bill Cheeseman <email@hidden>
  • Date: Sun, 30 Apr 2006 11:43:19 -0400
  • Thread-topic: Correct syntax for GUI Scripting 'click at' command

PreFab UI Browser generates an incorrect script for the GUI Scripting 'click
at' command. The correct usage is illustrated by this script:

 activate application "My App"
 tell application "System Events"
     tell process "My App"
         -- GUI Scripting statements:
         tell button 1 of window "My Window"
             set {xPosition, yPosition} to position
             set {xSize, ySize} to size
         end tell
         click at {xPosition + (xSize div 2), yPosition + (ySize div 2)}
     end tell
 end tell

The key points are (1) the hotspot should be calculated in top-left relative
global screen coordinates, and (2) the 'click at' command should be
addressed to the target process instead of a specific UI element.

We'll fix this in UI Browser 2.0. Apologies for the error.

--

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

  • Prev by Date: Re: SOAP (is very dirty)
  • Next by Date: Re: SOAP (is very dirty)
  • Previous by thread: Re: Podcast folder size error.
  • Index(es):
    • Date
    • Thread