Skip to content

Instantly share code, notes, and snippets.

@rdmarsh
Last active December 19, 2015 07:09
Show Gist options
  • Save rdmarsh/5916113 to your computer and use it in GitHub Desktop.
Save rdmarsh/5916113 to your computer and use it in GitHub Desktop.
Apple script function to convert dvorak to qwerty
--function to convert dvorak to qwerty
on dvorak_to_qwerty(dvorak_text)
set the dvorak_string to "',.pyfgcrlaoeuidhtns;qjkxbmwvz"
set the qwerty_string to "qwertyuiopasdfghjkl;zxcvbnm,./"
set the qwerty_text to ""
repeat with dvorak_char in dvorak_text
set x to the offset of dvorak_char in the dvorak_string
if x is not 0 then
set the qwerty_text to (the qwerty_text & character x of the qwerty_string) as string
else
set the qwerty_text to (the qwerty_text & dvorak_char) as string
end if
end repeat
return the qwerty_text
end dvorak_to_qwerty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment