Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.