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


Click here to return to the 'For use with all browsers' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
For use with all browsers
Authored by: pwestbro on Jul 11, '03 04:19:52PM
For those that don't want to be forced to use Safari, I have modified the script to open the web page in the default browser:
property nameOfTrack : ""
property nameOfAlbum : ""
property nameOfArtist : ""

tell application "iTunes"
	copy name of current track to nameOfTrack
	copy album of current track to nameOfAlbum
	copy artist of current track to nameOfArtist
	
	set nameOfTrack to my parseWord(nameOfTrack)
	set nameOfAlbum to my parseWord(nameOfAlbum)
	set nameOfArtist to my parseWord(nameOfArtist)
end tell
tell application "Finder"
	open location "http://www.google.com/search?hl=en&ie=ISO-8859-1&btnI=I%27m+Feeling+Lucky&q=-site:amazon.com+-site:moviepundit.com+" & nameOfArtist & "+" & nameOfTrack & "+Lyrics"
end tell

on parseWord(myWord)
	set myDelims to {"(", ")", "!", "'", "-", "@", "#", "$", "%", ¬
		"^", "&", "*", "-", "+", "=", ":", ";", ",", ".", "/", "", "?", "{", "}", "[", "]"}
	repeat with currentDelim in myDelims
		set AppleScript's text item delimiters to currentDelim
		set myWords to every text item of myWord
		set AppleScript's text item delimiters to {""}
		set myWord to myWords as string
	end repeat
	
	-- convert double spaces to single
	set AppleScript's text item delimiters to " "
	set myWords to every text item of myWord
	set AppleScript's text item delimiters to {" "}
	set myWord to myWords as string
	
	-- get rid of spaces
	set AppleScript's text item delimiters to {" "}
	set myWords to every text item of myWord
	set AppleScript's text item delimiters to {"+"}
	set myWord to myWords as string
	return myWord
end parseWord



[ Reply to This | # ]