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


Click here to return to the 'Some comments' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Some comments
Authored by: hamarkus on Jul 10, '03 12:59:24PM

It works real nice. One thing though: The song must be playing or must have been playing (the loudspeaker icon has to be there), only selecting it is not sufficient. It takes the song currently playing or which played last, i.e. the one with the loudspeaker icon.
If you start up iTunes no song has that icon yet and you get the error message: 'The variable NameofTrack is not defined.' Simply play any song to assign the icon.

As a side note: When I hit the 'Check Syntax' button in the Script Editor, it started iTunes 3 in Classic (to get its Dictionary) and the Editor was stuck showing the spinning disc, with the TrueBlueEnvironment (aka Classic) taking up all the idle processor cycles ... until I figured out that iTunes 3 was asking for my attention to respond to a dialog box which did come to front on its own.



[ Reply to This | # ]
Some comments
Authored by: DougAdams on Jul 10, '03 01:26:21PM
To get the single selected track: set theTrack to (item 1 of selection) Also, it might be good to check for a current track first, then see if there's a selection
tell application "iTunes"
	if player state is playing then
		set theTrack to current track
	else if selection is not {} then
		set theTrack to (item 1 of selection)
	end if
end tell
Cheers,
Doug
Doug's AppleScripts for iTunes

---



[ Reply to This | # ]

Get the lyrics even if iTunes not playing the track.
Authored by: snow white on Jul 22, '03 04:00:09AM

An easy script modification makes it work even if the selected track is not currently playing. Add two "playpause" commands right after the tell command to iTunes, as in--

tell application "iTunes"
playpause
playpause

copy name of current track to nameOfTrack
...

This mod works by toggling the iTunes play/pause button twice.

---
snow white

[ Reply to This | # ]