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


Click here to return to the 'GeekTool - Useful and fun info on the desktop' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
GeekTool - Useful and fun info on the desktop
Authored by: Frederico on Jul 08, '04 08:59:08PM
I happen to like a fair amount of information displayed; this is a modified version of a script I've been using for awhile with straight AppleScript for use with GeekTool; the original brings up a dialog and option to edit the track when a specified field is empty and requires addressing. As I'm in the process of cataloging and defining 40 years of music, much of it from vinyl, into iTunes, it's quite handy to see a fair amount of info while I'm working (especially when stuck on the phone with a jabbering client). (:

Sample output:
'Slither' by 'Velvet Revolver' on '(single)' |
Rock | (please rate this track) | -2:49 of 4:16 | 
Free from Apple iTunes QT Videos
The script:
(*Display iTunes Info for GeekTool;  ©2004 by Frederico; frederico@mac.com *)
tell application "System Events"
	if exists process "iTunes" then
		tell application "iTunes"
			try	
				set {n, a, al, g, r, c, d, t} to ¬
					{name, artist, album, genre, rating, comment, duration, time} of current track
				set e to player position
				set rT to my doTime(d - e)
				if n is "" then set n to "(unknown name)"
				if a is "" then set a to "(unknown artist)"
				if al is "" then set al to "(unknown album)"
				if g is "" then set g to "(unknown genre)"
				if r is less than 20 then set rs to "(please rate this track)"
				if r is greater than 19 then set rs to "*"
				if r is greater than 39 then set rs to "* *"
				if r is greater than 59 then set rs to "* * *"
				if r is greater than 79 then set rs to "* * * *"
				if r is greater than 99 then set rs to "* * * * *"
				if c is "" then set c to "(no comment)"
				set displayInfo to "'" & n & "'" & " by " & "'" & a & "'" & " on " & "'" & al & "'" & ¬
					" | " & g & " | " & rs & " | " & "-" & rT & " of " & t & " | " & c
				
			on error errMSG number errnum
				log errMSG
				set displayInfo to "(iTunes Player is not playing)  " & "(" & errMSG & ")"
			end try
		end tell
	else
		set displayInfo to "(iTunes Player not running)"
	end if
	return displayInfo
end tell
on doTime(x)
	set m to x div 60
	set s to (x - m * 60)
	if s < 10 then set s to "0" & s
	return m & ":" & s
end doTime
HTH PS: Rob, I hope this isn't formatted too wide; I used AS carriage returns to squeeze it up a bit. -- F

[ Reply to This | # ]