Re: GUI scripting?
Re: GUI scripting?
- Subject: Re: GUI scripting?
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 08 Apr 2005 07:48:17 -0700
On 4/8/05 7:09 AM, "Geoff Canyon" <email@hidden> wrote:
>
> Is there a way to script the arrow keys using GUI scripting? I haven't
> figured out how to encode an arrow key into a script.
The old OS 7/8/9 hack of emulating ASCII characters 28 through 31 still
seems to work in some contexts in OS X:
tell application "TextEdit" to activate
tell application "System Events"
tell process "TextEdit"
keystroke (ASCII character 28)
end tell
end tell
moves the cursor to the left.
In other contexts (like text fields in my AS Studio app) where that may not
work you can do it via the 'key code' command. I worked out that key code
125 and 126 work the up and down arrows, for example. It's supposed to be
machine-dependent, but I've been assured that all keyboards in recent years
(or decades) have the same key codes for the arrows.
--
Paul Berkowitz
_______________________________________________
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