idle keystroke

I would like to run a script only after a key is pressed. For example:

the computer is idle and a user presses the “0” key, then the script will activate “textedit”.
At such a point, the script will watch for another keystroke and then activate “Photoshop”

I’m having difficulty understanding how to read that keystroke from an idle position in the script…

Hi,

to assign a keyboard shortcut to a script
you need a third party tool like Butler, QuicKeys, FastScripts, Quicksilver .