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


Click here to return to the 'forget crontab!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
forget crontab!
Authored by: Embro on Feb 07, '02 02:31:04AM
Try this script instead and forget the crontab stuff. Save it as an application and just double click it. It will run in the background without sucking too much processor time. It will update aim about every minute.

--
-- Set AIM Profile to contain current iTunes track
-- by Ian Langworth - www.logicallemon.com
-- 2/3/2002 - thanks to Rick A. for the idea
-- shouts to Rick and Adam F.
-- modified by Mark S. aka Embro
-- put the contents of your profile between these quotes
-- (the track name will go above)
property profilebits : "
Music makes the world go round
"
-- this is the prompt that'll precede the track
property prompt : "What I'm playing in iTunes right now: "
-- ------------------------------------------
repeat
set the theTime to (the (current date) + 60)
repeat until the (current date) is greater than theTime
delay 60
end repeat
try
tell application "iTunes"
set theSong to (artist of current track) & " - " & (name of current track) & ""
end tell
on error
set theSong to "(no song playing)"
end try
try
tell application "AOL Instant Messenger (SM)"
set profile to prompt & theSong & return & profilebits
end tell
end try
end repeat



[ Reply to This | # ]
forget crontab!
Authored by: MeStinkBAD on Feb 07, '02 09:15:01AM

Ummm... wouldn't the better approach be to create an script application that uses the idle handler? Something like this...

---

on display_iTunes_data()
tell application "Finder"
if not (exists process "iTunes") or not (exists process "AOL Instant Messenger (SM)") then
return true -- don't do anything if iTunes isn't running
end if
end tell

try
tell application "iTunes"
set theSong to (artist of current track) & " - "" & (name of current track) & """
end tell
on error
set theSong to "(no song playing)"
end try
try
tell application "AOL Instant Messenger (SM)"
set profile to prompt & theSong & return & profilebits
end tell
end try
end display_iTunes_data

on idle {}
display_iTunes_data()
return 60
end idle

---

I don't use AIM so I dunno if this will work, but it does compile! :)



[ Reply to This | # ]