Jul 17, '03 09:53:00AM • Contributed by: clabough
tell application "iTunes"
if player state is playing then
set artist_name to artist of current track
set track_name to name of current track
else
set artist_name to the artist of selection of browser window 1
set track_name to the name of selection of browser window 1
end if
end tell
set the artist_name to replace_chars(artist_name, " ", "+")
set the track_name to replace_chars(track_name, " ", "+")
tell application "Safari"
activate
set the URL of the front document to ¬
"http://rhythm.harmony-central.com/olga-query.php?key=" & artist_name ¬
& "+" & track_name
end tell
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
[robg adds: Although I'm not a guitarist :-), I can verify that the script works as described...]
