Skip to content

Instantly share code, notes, and snippets.

@elventear
Created August 6, 2014 19:11
Show Gist options
  • Save elventear/cd508811db24b108dc72 to your computer and use it in GitHub Desktop.
Save elventear/cd508811db24b108dc72 to your computer and use it in GitHub Desktop.
Type text from Clipboard
set numbers_key_codes to {29, 18, 19, 20, 21, 23, 22, 26, 28, 25}
set input to do shell script "pbpaste"
if (input is not missing value) then
tell application "System Events"
repeat with char in the characters of input
try
set test to char as number
key code numbers_key_codes's item (char + 1)
on error
keystroke char
end try
end repeat
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment