• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Rot 13
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rot 13


  • Subject: Re: Rot 13
  • From: Paul Skinner <email@hidden>
  • Date: Mon, 02 Jul 2001 00:01:09 -0400

on 7/1/01 9:22 PM, Michelle Steiner wrote:

> 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

Snip rot13 script

Not my code. Sorry I don't have the author's name recorded.
The rot13 text given in the call is a clue.

on ROT13(theTEXT)
--on ROT13(theTEXT)
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" & "abcdefghijklmnopqrstuvwxyz"
set alphabets to result
"NOPQRSTUVWXYZ" & "ABCDEFGHIJKLM" & "nopqrstuvwxyz" & "abcdefghijklm"
set rotAlphabets to result
----------
set theTEXT to items of theTEXT
set sentinal to ASCII character 1 -- (sentinal & character) == not
processed
set text item delimiters to {sentinal}
set theTEXT to sentinal & theTEXT as string -- all unprocessed
repeat with x from 1 to (26 + 26)
set text item delimiters to {sentinal & item x of alphabets}
set theTEXT to text items of theTEXT
set text item delimiters to {item x of rotAlphabets}
set theTEXT to theTEXT as string
end repeat
-- clean up
set text item delimiters to {sentinal}
set theTEXT to text items of theTEXT
set text item delimiters to {""}
return theTEXT as string
--end ROT13
end ROT13

ROT13("Trbetr Yhpnf vf n zrqvbper gnyrag jub tbg ernyyl yhpxl jvgu Fgne
Jnef.")

--
"AppleScript is digital duct tape."
Paul Skinner


  • Follow-Ups:
    • Re: Rot 13 (OT)
      • From: Mr Tea <email@hidden>
References: 
 >Rot 13 (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Rot 13
  • Next by Date: Re: PORTALS IN FILEMAKER
  • Previous by thread: Rot 13
  • Next by thread: Re: Rot 13 (OT)
  • Index(es):
    • Date
    • Thread