Last active
December 19, 2015 07:09
-
-
Save rdmarsh/5916113 to your computer and use it in GitHub Desktop.
Apple script function to convert dvorak to qwerty
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
--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