user1935934
user1935934

Reputation: 41

How to Detect Keypress in Applescript

I have several nested loops in an Applescript, but I need a simple way for the user to stop executing the entire script. A (rather inefficient) idea I had was to check if keys were pressed within the quickest loop, and pass error number -128 in a keypress event, but I can't find a way to detect what keys were pressed. I've seen recommendations for Jon's Commands, but I can't seem to install it properly even though it's in my ApplicationScripts -- (keys pressed) doesn't work. Alternately, is there a better way to stop running the script across multiple loops?

Upvotes: 4

Views: 1809

Answers (1)

adayzdone
adayzdone

Reputation: 11238

Try using command . to stop the script

Upvotes: 1

Related Questions