AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

change all letters in string to other letters

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
etopsirhc



Joined: 12 Mar 2008
Posts: 32
Location: OR

PostPosted: Fri Apr 11, 2008 3:07 am    Post subject: change all letters in string to other letters Reply with quote

there's probably a simple awnser to this i'm not getting but
i'm trying to make an albed (FFX / X2 language) translator where as soon as u copy text it will translate it and paste it back where it was and has a toggle hot key so u can translate it back and turn it if when u need to
the closest thing that i could get to work was remaping my keyboard


(this is the english to albed alpabet )
Code:

En  Al
^   ^
a = y
b = p
c = l
d = t
e = a
f = v
g = k
h = r
i = e
j = z
k = g
l = m
m = s
n = h
o = u
p = b
q = x
r = n
s = c
t = d
u = i
v = j
w = f
x = q
y = r
z = w


i know kinda what i need to do i just dont know how :
take the string that i got from the clipboard and break it into a substring array then take each substring(letter) and change itto it's counterpart, reasemble the string place it in the clipboard and paste it
Back to top
View user's profile Send private message Visit poster's website
HugoV



Joined: 27 May 2007
Posts: 650

PostPosted: Fri Apr 11, 2008 1:41 pm    Post subject: Reply with quote

Code:
OriginalString=
(
hElLo wOrld, thIs Is. #, Text <>"ABCDE abcd"[e]1234-5-68;97
!@#$^&*()_+|~\/:'{}.=
new lines as well?

but

of (course)!
)
;          abcdefghijklmnopqrstuvwxyz ; english
Conversion=ypltavkrezgmshubxncdijfqrw ; albed
TranslatedString=
StringCaseSense Off

Loop, Parse, OriginalString
   {
   Ascii:=Asc(A_LoopField)
   If A_LoopField in A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
      {
      Replace:=SubStr(Conversion, Ascii-96,1)
      If (Ascii > 64) AND (Ascii < 91) ; upper case character
         {
         Replace:=SubStr(Conversion, Ascii-64,1)
         StringUpper,Replace,Replace
         }
      TranslatedString:=TranslatedString . Replace
      }
      Else
         TranslatedString:=TranslatedString . A_LoopField
   }
MsgBox % TranslatedString

Loop, Parse, TranslatedString
   {
   Ascii:=Asc(A_LoopField)
   If A_LoopField in A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
   {
   Replace:=Chr(InStr(Conversion, A_LoopField)+96)
   If (Ascii > 64) AND (Ascii < 91) ; upper case character
      {
      Replace:=Chr(InStr(Conversion, A_LoopField)+64)
      StringUpper,Replace,Replace
      }
   NewTranslatedString:=NewTranslatedString . Replace
   }
      Else
      NewTranslatedString:=NewTranslatedString . A_LoopField
   }
MsgBox % NewTranslatedString
Back to top
View user's profile Send private message
etopsirhc



Joined: 12 Mar 2008
Posts: 32
Location: OR

PostPosted: Fri Apr 11, 2008 8:59 pm    Post subject: Reply with quote

i bow to u o lord of the script for your knolade knows no bounds
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group