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: trekan on Aug 12, '04 04:35:38PM
This version is rewritten more to my liking and also it uses the AppleScript idle-handler, which makes it possible to have updates more often than every minute. In this example it runs every 10 seconds. For this to work, the AppleScript has to be saved as an application with the "stay open" option on. Cronnix is not necessary in this version.
on checkOSD()
	tell application "System Events"
		if (exists process "iTunes") then
			tell application "iTunes"
				if not (minimized of first EQ window) and (player state is playing) then my showOSD()
			end tell
		end if
	end tell
end checkOSD

on showOSD()
	tell application "iTunes"
		tell current track to set {trk_arts, trk_name, trk_albm} to {the artist, the name, the album}
	end tell
	tell application "LanOSD"
		message kind "itunes-song" text trk_arts fade delay 65 over 1 quadrant 8 icon "music"
		message kind "itunes-song" text trk_name fade delay 65 over 2
		message kind "itunes-song" text "From \"" & trk_albm & "\"" fade delay 65 over 3
	end tell
end showOSD

on idle
	my checkOSD()
	return idleInterval
end idle

set idleInterval to 10
my checkOSD()


[ Reply to This | # ]
bug fix
Authored by: trekan on Aug 12, '04 04:39:29PM
oops

property idleInterval : 10

on checkOSD()
	tell application "System Events"
		if (exists process "iTunes") then
			tell application "iTunes"
				if not (minimized of first EQ window) and (player state is playing) then my showOSD()
			end tell
		end if
	end tell
end checkOSD

on showOSD()
	tell application "iTunes"
		tell current track to set {trk_arts, trk_name, trk_albm} to {the artist, the name, the album}
	end tell
	tell application "LanOSD"
		message kind "itunes-song" text trk_arts fade delay 65 over 1 quadrant 8 icon "music"
		message kind "itunes-song" text trk_name fade delay 65 over 2
		message kind "itunes-song" text "From \"" & trk_albm & "\"" fade delay 65 over 3
	end tell
end showOSD

on idle
	my checkOSD()
	return idleInterval
end idle

my checkOSD()


[ Reply to This | # ]
Create an iTunes song info bezel with free tools
Authored by: nevyn on Aug 13, '04 10:45:29AM

So THAT's how to do it! This was how I tried to do it the first time around, but I just wasn't good enough at AppleScript... Thanks! Oooh, this is great. Now I don't have to deal with the cron hassle...

---
?



[ Reply to This | # ]
Create an iTunes song info bezel with free tools
Authored by: iggybird on Aug 14, '04 02:32:25PM
You can also use the delay command. Here's an example as it directly relates to waiting for a song to be over:
delay (get finish of current track) - 5 - (get player position)
You might have to change the "5" to something else to time it correctly.

[ Reply to This | # ]
Create an iTunes song info bezel with free tools
Authored by: nevyn on Aug 17, '04 05:31:41AM

Yep, that's the command that eats ridiculous amounts of processor power.

---
?



[ Reply to This | # ]