Created
June 2, 2020 21:02
-
-
Save erik-megarad/e5a2c343d825049ad3cd43b8bfd9fa3c to your computer and use it in GitHub Desktop.
Applescript to type from clipboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on numberAsKeycode(theString) | |
tell application "System Events" | |
repeat with currentChar in (every character of theString) | |
set cID to id of currentChar | |
if ((cID ≥ 48) and (cID ≤ 57)) then | |
key code {item (cID - 47) of {29, 18, 19, 20, 21, 23, 22, 26, 28, 25}} | |
else | |
keystroke currentChar | |
end if | |
delay 0.03 | |
end repeat | |
end tell | |
end numberAsKeycode | |
set texttowrite to the clipboard | |
numberAsKeycode(texttowrite) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment