• 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: Nice Automator article on O'Reilly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Nice Automator article on O'Reilly


  • Subject: Re: Nice Automator article on O'Reilly
  • From: "Gary (Lists)" <email@hidden>
  • Date: Fri, 06 May 2005 18:49:49 -0400

"David Marshall" wrote:

> Years
> ago I was able to write an absurd little command-line program that took
> as input an English word and returned its Pig Latin equivalent. (Try
> THAT in AppleScript!)


Sloppy, poor Pig Grammar and no punctuation but funny, nonetheless.

--
property vowels : {"a", "e", "i", "o", "u"}
property noPig : {"the"}
set mySentence to "Gary thinks the Xcode list reads like Martians at a
party"
set myWords to words of mySentence
set pigWords to {}
repeat with aWord in myWords
    if (aWord is not in noPig) and [NOBREAK]
       (text item 1 of aWord is not in vowels) and [NOBREAK]
       (length of aWord > 3) then
        set wti to text items of aWord
        set moveChar to item 1 of wti
        set aWord to (the rest of wti as text) & "-" & moveChar & "ay"
    end if
    copy aWord & " " to end of pigWords
end repeat
set pigSentence to (pigWords as text)

--> "ary-Gay hinks-tay the code-Xay ist-lay eads-ray ike-lay artians-May at
a arty-pay "

--
Gary
...a big fan of Ben Stiller's old "Pig Latin Lover" routine.

"ye-Bay, ye-Bay iss-May American ie-Pay..."


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Nice Automator article on O'Reilly
      • From: kai <email@hidden>
References: 
 >Re: Nice Automator article on O'Reilly (From: David Marshall <email@hidden>)

  • Prev by Date: Signatures, Mail.app and Tiger
  • Next by Date: Re: Nice Automator article on O'Reilly
  • Previous by thread: Re: Nice Automator article on O'Reilly
  • Next by thread: Re: Nice Automator article on O'Reilly
  • Index(es):
    • Date
    • Thread