|
|
For use with all browsers
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
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|