I stupidly ran an AppleScript script on my Mac running macOS Mojave and the script is running in an endless loop. I thought something obvious like pressing the Esc key would end the program. However, neither the Esc key or anything like CTRL + Z etc works.
How can I interrupt the loop and end the script using a hotkey or similar method?
I tried to click the program but it won't let me unless the loop of the keystrokes stop.
NOTE: I need to save my work so I can't shut it down.