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

Click here to return to the 'Create an iTunes song info bezel with free tools' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create an iTunes song info bezel with free tools
Authored by: pr10n on Aug 12, '04 09:34:13PM
I too highly recommend butler. As for the applescript I don't know of any hook either. Here is a simplified version of something I wrote to put the iTunes info onto my web server. I sure it could be modified for your own use. Determines how much time remain in the song that is play and sits idly for that time to elapse.

	on idle theObject
		if iTunesRunning then -- If iTunes has been launched
			tell application "iTunes" -- Begin communicating with iTunes
				if player state is playing then -- iTunes is playing
					set thisTrack to the current track
					set tID to thisTrack's database ID
					set tName to thisTrack's name
					set tArtist to thisTrack's artist
					set tAlbum to thisTrack's album
					set tRating to thisTrack's rating
					-- Set idle time to remaining + 5 seconds
					set idleTime to (thisTrack's duration) - player position + 5
				end if
			end tell
		end if

		-- To minimize resource usage never query in intervals less than 15 seconds
		if idleTime < 15 then
			set idleTime to 15
		end if

		return idleTime

	end idle
It was written in xcode you can get the binary and source here if you want to have a look

[ Reply to This | # ]