
Feel free to use it if it's of any use, or modify it if you need to reform the URL that gets sent to Safari etc.
Put it in the same place as Steve's iTunes Meta Data script - ~/Library/Scripts/Applications/Max/
Neil
Code: Select all
-- GoogleAlbumArt
--
-- Applescript to search google images for album art.
--
tell application "Max"
set maxdisk to document 1
set ar to artist of maxdisk
set al to title of maxdisk
set comp to compilation of maxdisk
--If compilation, blank out the artist to prevent searches on single artist name
if (comp) then set ar to ""
--Make string of all search words, " " seperator to help later
set my_search to ar & " " & al
--URL based on searching google images with Safari - you might need to form your own URL
--depending on browser. URL is made in 3 parts
--
set my_url to "http://images.google.com/images?client=safari&rls=en-us&q="
--add search terms to URL
set search_words to length of words of my_search
if search_words = 0 then
return
else if search_words = 1 then
set my_url to my_url & my_search
else
repeat with i from 1 to search_words
set my_url to my_url & (word i of my_search)
if (i < search_words) then set my_url to my_url & "+"
end repeat
end if
--form end of URL
set my_url to my_url & "&ie=UTF-8&oe=UTF-8&um=1&sa=N&tab=wi"
end tell
tell application "Safari" to activate
tell application "Safari"
make new document at end of documents
set URL of document 1 to my_url
end tell