Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create a radio station with announcements via Nicecast' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a radio station with announcements via Nicecast
Authored by: Señor Epiphyte on Apr 09, '08 09:15:51PM

This is where I am with the announcements. I am trying to decide whether to:

* run a single script forever...perhaps timeout if iTunes isn't running for 5 minutes.
* Call the script every five to 6 minutes with cron and capture most songs.
* other

-- Play Party Shuffle to keep it going.
tell application "System Events"
if (name of processes) contains "iTunes" then
tell application "iTunes"
-- Don't insert this if we're not listening to the Party Shuffle
if (player state is playing) then

set currenttrack to the name of current track
set currentartist to the artist of current track
set tracktime to the duration of current track
set trackremainder to the player position
set waittime to (tracktime - trackremainder)

-- back off a bit from the end to allow for crossfade and say it before the song is completed
delay (waittime - 10)
say "That was"
say (currenttrack)
say "by"
say (currentartist)

else
-- If we're not listening to the Party Shuffle, then we should
say time string of (current date)
say "Me Likey Music!"
play playlist "Party Shuffle"

end if
end tell
end if
end tell



[ Reply to This | # ]
Create a radio station with announcements via Nicecast
Authored by: DougAdams on Dec 22, '08 09:42:54AM

Put it in a stay-open script application with an idle handler.

---
Doug's AppleScripts for iTunes
dougscripts.com



[ Reply to This | # ]