• 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: GUI scripting?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: GUI scripting?
      • From: Yvan KOENIG <email@hidden>
References: 
 >GUI scripting? (From: Geoff Canyon <email@hidden>)

  • Prev by Date: GUI scripting?
  • Next by Date: Re: GUI scripting?
  • Previous by thread: GUI scripting?
  • Next by thread: Re: GUI scripting?
  • Index(es):
    • Date
    • Thread