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

Search the OLGA tabulature archives for iTunes songs Apps
I am a guitarist and I wanted a way to quickly get tabulature for the music I was listening to in iTunes. So, I made this little script that will search harmony-central.com for the artist and track title of the currently playing track in iTunes or the selected track if it isn't playing. You can save this script to ~/Library -> iTunes -> Scripts, and it will be in the AppleScript menu in iTunes.

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...]
    •    
  • Currently 3.33 / 5
  You rated: 5 / 5 (3 votes cast)
 
[5,614 views]  

Search the OLGA tabulature archives for iTunes songs | 10 comments | Create New Account
Click here to return to the 'Search the OLGA tabulature archives for iTunes songs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Search the OLGA tabulature archives for iTunes songs
Authored by: Jay on Jul 17, '03 12:02:46PM

Great, works well, thanks!



[ Reply to This | # ]
Search the OLGA tabulature archives for iTunes songs
Authored by: jgross on Jul 17, '03 12:51:23PM

<sigh> I must be doing something wrong. I use the script and it takes me to a page where I have to download the tabulature. It uses a".tab" suffix. What program will open that? Should I be seeing the tabs in the browser window? </sigh>

Thanks

James



[ Reply to This | # ]
Search the OLGA tabulature archives for iTunes songs
Authored by: charles2003 on Jul 17, '03 06:52:03PM

.tab is just the extension, probably. Open with SimpleText of TextEdit and view with a monospace font like courier.

To the writer of the script. Why not contribute this script to the following website?

http://www.malcolmadams.com/itunes/
Doug's AppleScripts for iTunes



[ Reply to This | # ]
He has!
Authored by: DougAdams on Jul 28, '03 02:13:07PM
Why not contribute this script to the following website?
OLGA Tabulature Search is now posted.

Doug
Doug's AppleScripts for iTunes

---



[ Reply to This | # ]

Search the OLGA tabulature archives for iTunes songs
Authored by: amontague on Jul 17, '03 07:32:19PM

Where do you find the Applescript menu for iTunes?



[ Reply to This | # ]
Search the OLGA tabulature archives for iTunes songs
Authored by: cudaboy_71 on Jul 23, '03 11:05:19AM

~/Library/iTunes/Scripts

if you dont have a Scripts folder at this location, add one. then, any scripts you add to the folder will be in a script pulldown menu in iTunes.

---
if it aint broke, break it!



[ Reply to This | # ]
Search the OLGA tabulature archives for iTunes songs
Authored by: n.amadori on Jul 18, '03 02:24:16PM

The script doesn't work if Safari is up but with no opened windows. If you get a NSReceiverEvaluationScriptError:4 simply open a new window.

Any suggestions on how to correct this behavior ???

Nic :-)



[ Reply to This | # ]
Error using this script with Camino
Authored by: osxpounder on Jul 22, '03 03:54:26PM

I tried using this script, but substituted "Camino" in place of "Safari" .... it seems that wasn't enough, since now all I get is an error that says:

"NSCannotCreateScriptCommandError"

Any ideas what's wrong, and/or how I could get this to work with Camino?

---
--
osxpounder



[ Reply to This | # ]
Search the OLGA tabulature archives for iTunes songs
Authored by: laughlin on Jul 25, '03 04:01:43PM

I have a question regarding this applescript. I am brand new to applescripting. So new that I just recieved my copy of Applescript in a Nuthshell today :).
I was wondering how you would be able to search a website using this script that puts the alphabetical letter of whatever band in front of the artist.
example: I would like to use this for mxtabs.net if i search for the song battery from metallica i get
http://mxtabs.net/tabs.php?path=Guitar,m,799,Metallica,Battery,3458

then Ramones beat on the brat gives me
http://mxtabs.net/tabs.php?path=Guitar,r,1026,Ramones,Beat+On+The+Brats,93341

So i see that not only does the letter change but there is an numerical number to go with each artist. So I suppose that this site would be nearly impossible to script.

If anyone has any input please let me know.

Thanks



[ Reply to This | # ]
Search the OLGA tabulature archives for iTunes songs
Authored by: clabough on Aug 05, '03 05:30:40PM

Ok, if you want to know the basic commands you can open the Script Editor and then File>Open Dictionary>Standard Additions
This seems to have a lot of standard commands in it.

It may also be the case that those urls that you are seeing as output on that site are results of the search and not the search itself. What I mean to say is, try out the method I used in this script and it might just work do start the search and then you will see the familiar odd numberings and stuff.maybe put " marks where you think they should go to group artist and song separately ... if you can figure out how
good luck!



[ Reply to This | # ]