I have a script that I want to be able to stop at any time by pressing a key on the keyboard. Here’s my script.
set CR to ASCII character of 13
tell application "System Events"
tell application "Microsoft Word" to activate
keystroke (ASCII character 4) using shift down -- end
keystroke "c" using command down -- copy
keystroke (ASCII character 31) & (ASCII character 1) -- arrow down and home
tell application "Microsoft Excel" to activate
keystroke "v" using command down -- paste
keystroke (ASCII character 29) -- arrow right arrow
end tell
Can someone tell me how I can loop infinitely this script until I press a key or combination of keys. Thanks!