keyboard trapping

Is it possible to trap keypresses in a script? I don’t want to interrupt the script flow, I’d just like to know if a key has been pressed, and then be able to get the ascii code.
Thanks

: Is it possible to trap keypresses in a script? I don’t want to
: interrupt the script flow, I’d just like to know if a key has
: been pressed, and then be able to get the ascii code.

: Thanks

You can use the “keys pressed” command in Jon’s Commands to get a list of the keys that are depressed when the command is executed. There is an “input state” command in Akua Sweets that does the same thing.
Marc K. Myers
Marc@AppleScriptsToGo.com
AppleScriptsToGo

[02/21/2002 10:58:09 PM]

Thanks a lot, Marc, I’ll check those out. I’d forgotten to mention that I’m running under X, so hopefully these are X-compatible.

: You can use the “keys pressed” command in Jon’s
: Commands to get a list of the keys that are depressed when the
: command is executed. There is an “input state”
: command in Akua Sweets that does the same thing.
: Marc K. Myers < Marc@AppleScriptsToGo.com >
: AppleScriptsToGo
: 4020 W.220th St.
: Fairview Park, OH 44126
: (440) 331-1074
: [02/21/2002 10:58:09 PM]

: Thanks a lot, Marc, I’ll check those out. I’d forgotten to
: mention that I’m running under X, so hopefully these are
: X-compatible.

AFAIK no third-party scripting additions are OS X compatible, one reason I’m avoiding conversion to the new OS. I’ve written hundreds of scripts and at least half of them use third-party scripting additions.
Marc K. Myers
Marc@AppleScriptsToGo.com
AppleScriptsToGo

[02/22/2002 6:06:25 PM]

There has been one brought forward into OS X : 24U Appearance OSAX. It drives the Ibis batch-posting utility for Brian Clark’s Thoth newsreader (NNTP not RSS). I remember back in my own legacy Mac days trying both it and DialogDirector, alternately but very close in real-time, to “spritz up” dialog boxes in my existing scripts. I remember getting commands and calls mixed up between both those OSAXen, getting numerous errors and eventually giving up. Ah well.

Silversleeves

In OSX, you should try the Extra Suites OSAX (look or google this board)


tell application "Extra Suites" to return ES keys down