On Sep 15, 2015, at 19:18, Shane Stanley < email@hidden> wrote: I suspect you'll need to build a conversion table because there's no usable pattern to it -- A = 0, S = 1, Z = 6. And you'll need to use a modifier key for uppercase -- these are codes for keys, not letters.
______________________________________________________________________
Hey Shane,
I was afraid I'd have to do that...
Just remember it is US keyboard-dependent.
That has its problems. Any reason you're not using keystroke instead?
Because it doesn't work when retyping keystrokes in Russian. :)
Since this can't be done easily enough on the fly I think the translation table is the way to go,
I won't need to use key code.
And I can let the user build his own table after I figure out the nuts and bolts.
In essence I have a Keyboard Maestro user who types in both English and Russian.
Frequently he types some text in English that he really wanted to type in Russian, and he wants to rewind and fix that in an automated fashion.
Something like this will probably be quite sufficient once wrapped in a macro:
------------------------------------------------------------------------------------------- set _english to "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" set _russian to {"ф", "и", "с", "в", "у", "а", "п", "р", "ш", "о", "л", "д", "ь", "т", "щ", "з", "й", "к", "ы", "е", "г", "м", "ц", "ч", "н", "я", "Ф", "И", "С", "В", "У", "А", "П", "Р", "Ш", "О", "Л", "Д", "Ь", "Т", "Щ", "З", "Й", "К", "Ы", "Е", "Г", "М", "Ц", "Ч", "Н", "Я"}
set _text to "ghbdtn" set _text to characters of _text
considering case repeat with i in _text set contents of i to item (offset of (contents of i) in _english) of _russian end repeat end considering
return _text as text
--> привет -------------------------------------------------------------------------------------------
And the end result will be much faster too.
Thanks for the help.
-- Take Care, Chris
|