Correct syntax for GUI Scripting 'click at' command
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