ESC handle by AppleScript

tell application “System Events”
tell application “TextEdit” to activate
tell application “TextEdit” to run
keystroke “s” using {command down}
key code 53
end tell

——————-

tell application “System Events”
tell application “TextEdit” to activate
tell application “TextEdit” to run
keystroke “s” using {command down}
key code 53 –esc
–key code 36 — enter
–key code 32 –space bar

end tell

–tell process “Microsoft Messenger”
–keystroke “omg testing lol”
–key down shift
–delay 0.2 — adjust delay as needed
–key code 36
–key up shift
–keystroke “testing line 2” & return

Share