Rot 13
Rot 13
- Subject: Rot 13
- From: Michelle Steiner <email@hidden>
- Date: Sun, 1 Jul 2001 18:22:11 -0700
Can anyone come up with a better way than the following to impliment
rot13 in Applescript? I tried to figure out a way to do it with TIDs,
but I haven't been able to figure that out.
--Michelle
set oldText to "Zvpuryyr Fgrvare"
set newText to ""
repeat with i in characters of oldText
set oldAscii to ASCII number i
if oldAscii is greater than 64 and oldAscii is less than 91 then
if oldAscii is less than 78 then
set newText to newText & (ASCII character (oldAscii + 13))
else
set newText to newText & (ASCII character (oldAscii - 13))
end if
else if oldAscii is greater than 96 and oldAscii is less than 123 then
if oldAscii is less than 110 then
set newText to newText & (ASCII character (oldAscii + 13))
else
set newText to newText & (ASCII character (oldAscii - 13))
end if
else
set newText to newText & (i as string)
end if
end repeat
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------