Re: Thirteen Scripters Scripting
Re: Thirteen Scripters Scripting
- Subject: Re: Thirteen Scripters Scripting
- From: "Nigel Garvey" <email@hidden>
- Date: Sat, 27 Dec 2008 13:13:26 +0000
Thanks to David and everyone else for this thread. It's been very
entertaining! :D
"Mark J. Reed" wrote on Wed, 24 Dec 2008 20:18:53 -0500:
>On Wed, Dec 24, 2008 at 8:07 PM, Michelle Steiner
><email@hidden> wrote:
>> repeat with x from 21 to 24
>> say (x as text) & "th"
>> end repeat
>
>Well, now, that's just cool. Thanks!
>
>Kind of a shame there's no built-in way to get the proper textual
>form, though, rather than relying on the text-to-speech to transform
>it.
The AppleScript compiler does something similar:
2th item of myList --> compiles to '2nd item of myList'.
However, here 'th', 'st', 'nd', and 'rd' are completely interchangeable.
Ed Stockly wrote on Wed, 24 Dec 2008 19:19:41 -0800:
> set AppleScript's text item delimiters to {" "}
> set thisDaysStuff to every text of thisDaysStuff
'every text item', perhaps?
Here's a further development, using a slightly simpler approach. In
England, we spread "gold" over two notes rather than singing "golden" and
I've attempted to fudge that here:
set theVoice to "Trinoids" -- tone deaf carolers
set longer to "[[rate 70]]"
set slower to "[[rate 160]]"
set faster to "[[rate 210]]"
set special to "[[emph +]]"
set onThe to slower & "on the "
set dayOfChristmas to "th Day of Christm-as my " & faster & " true
love" & slower & " sent to " & longer & "me, "
set giftList to "twelve drummers-drumming
eleven pipers-piping
ten lords ah-leaping
nine ladies-dancing
eight maids uh-milking
seven swans uh-swimming
six geese uh-laying
" & special & " five, " & slower & special & "guh" & special & "old,, "
& special & " rings, , " & faster & "
four calling birds
three French hens
two turtle doves and
" & "uh " & slower & special & " par-tridge in uh pear " & special &
"tree" & longer & "ee,,"
repeat with n from 1 to 12
say (onThe & n & dayOfChristmas) using theVoice
say (slower & text from paragraph -n to -1 of giftList) using theVoice
end repeat
It was mentioned in a quiz show on the telly over Christmas that while
most of this song is traditional, the "Five gold rings" line is copyrighted!
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden