Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Detect Keypress in Applescript

Tags:

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?

like image 804
user1935934 Avatar asked May 14 '26 00:05

user1935934


1 Answers

Try using command . to stop the script

like image 149
adayzdone Avatar answered May 18 '26 02:05

adayzdone