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


Click here to return to the 'A script to display the current iTunes song's lyrics' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to display the current iTunes song's lyrics
Authored by: codesmith on Jul 10, '03 02:40:25PM
You may find this works a little better. It checks for missing data, and builds the query accordingly. If all the data is there, then it just tries to display the song. Also I changed the display url to use print.php instead of lyrics.php to avoid the "No referring page" error.
on openBrowser(nameOfArtist, nameOfAlbum, nameOfTrack)
	tell application "Safari"
		activate
		make new document at end of documents
		if nameOfArtist = "" and nameOfAlbum = "" then
			set URL of document 1 to ¬
				"http://search.lyrics.astraweb.com/?word=" & nameOfTrack
		else if nameOfTrack = "" and nameOfAlbum = "" then
			set URL of document 1 to ¬
				"http://search.lyrics.astraweb.com/?word=" & nameOfArtist
		else if nameOfTrack = "" and nameOfArtist = "" then
			set URL of document 1 to ¬
				"http://search.lyrics.astraweb.com/?word=" & nameOfAlbum
		else if nameOfArtist = "" then
			set URL of document 1 to ¬
				"http://search.lyrics.astraweb.com/?word=" & ¬
				nameOfAlbum & "..." & nameOfTrack
		else if nameOfAlbum = "" then
			set URL of document 1 to ¬
				"http://search.lyrics.astraweb.com/?word=" & ¬
				nameOfArtist & "..." & nameOfTrack
		else if nameOfTrack = "" then
			set URL of document 1 to ¬
				"http://search.lyrics.astraweb.com/?word=" & ¬
				nameOfArtist & "..." & nameOfAlbum
		else
			set URL of document 1 to "http://www.getlyrics.com/print.php?Artist=" & ¬
				nameOfArtist & "&Album=" & nameOfAlbum & "&Song=" & nameOfTrack
		end if
	end tell
end openBrowser


[ Reply to This | # ]