Re: Simple rot-13 encoding script
Re: Simple rot-13 encoding script
- Subject: Re: Simple rot-13 encoding script
- From: Jon Pugh <email@hidden>
- Date: Tue, 20 May 2003 22:05:34 -0700
At 5:27 PM -0700 5/20/03, Ashlin Aronin wrote:
>
repeat until currentChar = (count allChars)
>
set allChars to replace_chars(item currentChar of allChars, "a", "n")
>
set allChars to replace_chars(item currentChar of allChars, "b", "o")
>
set allChars to replace_chars(item currentChar of allChars, "c", "p")
>
set allChars to replace_chars(item currentChar of allChars, "d", "q")
>
set allChars to replace_chars(item currentChar of allChars, "e", "r")
>
set allChars to replace_chars(item currentChar of allChars, "f", "s")
>
set allChars to replace_chars(item currentChar of allChars, "g", "t")
>
set allChars to replace_chars(item currentChar of allChars, "h", "u")
>
set allChars to replace_chars(item currentChar of allChars, "i", "v")
>
set allChars to replace_chars(item currentChar of allChars, "j", "w")
>
set allChars to replace_chars(item currentChar of allChars, "k", "x")
>
set allChars to replace_chars(item currentChar of allChars, "l", "y")
>
set allChars to replace_chars(item currentChar of allChars, "m", "z")
>
set allChars to replace_chars(item currentChar of allChars, "n", "a")
>
set allChars to replace_chars(item currentChar of allChars, "o", "b")
>
set allChars to replace_chars(item currentChar of allChars, "p", "c")
>
set allChars to replace_chars(item currentChar of allChars, "q", "d")
>
set allChars to replace_chars(item currentChar of allChars, "r", "e")
>
set allChars to replace_chars(item currentChar of allChars, "s", "f")
>
set allChars to replace_chars(item currentChar of allChars, "t", "g")
>
set allChars to replace_chars(item currentChar of allChars, "u", "h")
>
set allChars to replace_chars(item currentChar of allChars, "v", "i")
>
set allChars to replace_chars(item currentChar of allChars, "w", "j")
>
set allChars to replace_chars(item currentChar of allChars, "x", "k")
>
set allChars to replace_chars(item currentChar of allChars, "y", "l")
>
set allChars to replace_chars(item currentChar of allChars, "z", "m")
>
currentChar = currentChar + 1
>
end repeat
Thank you. That takes me back to my first program, which was 1976 or so. Ah, to be young and foolish again, but you can never go back.
Unix does that to you.
Here's my "Rot13 the Clipboard" script:
set t to do shell script "pbpaste | tr 'a-zA-Z' 'n-za-mN-ZA-M'"
display dialog t buttons "OK" default button "OK"
pbpaste copies the clipboard to standard out (stout).
tr translates the range "a-zA-Z" to the rotated range "n-za-mN-ZA-M".
pbcopy does the opposite of pbpaste, although it's not used here.
The saddest part is that I Googled for the tr line, knowing that someone had obviously written this part back in the 80s.
Jon
"Unix, like Zappa, sort of transcends good and bad."
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.