iTunes Script

Discussion in 'iTunes' started by Dalton63841, Oct 18, 2010.

  1. Dalton63841

    Dalton63841 Active Member

    Joined:
    Sep 9, 2010
    Messages:
    888
    Likes Received:
    100
    Device:
    iPhone 4 (Black)
    I am working on an applescript to automatically add lyrics to iTunes tracks. It will actually be a combination of Dougs iTunes scripts from here along with my own code to autmate a few other things...

    I have a script that works perfectly when ran as a standalone app, but when I put it into my iTunes scripts folder and use it as an iTunes script, Get Lyrical freezes up immediately after launching. Any help would be appreciated. Here is the section of code responsible for working with Get Lyrical:

    Code:
    tell application "Get Lyrical" to activate
    
    tell application "System Events"
    	keystroke "1" using command down(*needed to make Get Lyrical frontmost*)
    	delay 5
    	keystroke "a" using {command down, shift down}(*sets active tagging*)
    end tell
    
    tell application "iTunes"
    	set view of front browser window to playlist "No Lyrics"
    	play view of front window
    	repeat with t from 1 to (index of last track of playlist "No Lyrics")
    		repeat 10 times(*following lines skip to next song after 10 seconds, while allowing script to be quit with a pause at any time*)
    			delay 1
    			if player state is stopped or player state is paused then exit repeat
    		end repeat
    		if player state is stopped or player state is paused then exit repeat
    		next track
    	end repeat
    end tell
    
    tell application "Get Lyrical"
    	quit
    end tell
    Any applescript gurus who might have any clues, or just insight to clean this up would be appreciated.
  2. asymmetric

    asymmetric Banned

    Joined:
    Oct 20, 2010
    Messages:
    52
    Likes Received:
    0
    So how exactly do we use this script?
  3. Dalton63841

    Dalton63841 Active Member

    Joined:
    Sep 9, 2010
    Messages:
    888
    Likes Received:
    100
    Device:
    iPhone 4 (Black)
    LOL Well the point of this thread was to actually get some help on it, since it causes Get Lyrical to freeze up if you run it as an iTunes Script...You can however save it as a standalone Applescript app and it works just fine for some reason...

    However, to use it as it is, go here. Put the No Lyrics to Playlist, and Clean No Lyrics playlist script in your iTunes Script folder.

    Now run the No Lyrics to Playlist script. That will put every track into a playlist called "No Lyrics" Go figure right?

    Make sure you install the lyrics app Get Lyrical...Then after your playlist is created you can run the Applescript App of the script in the first post. That script launches Get Lyrical, sets active tagging, brings the No Lyrics playlist to the front, and plays every track on that playlist 1 after another, for 10 seconds apeice.

    I chose 10 seconds because that ensures plenty of time to get and tag each track.

    While that is going you can just walk away from your Mac...When it finally does finish just run the Clean No Lyrics playlist iTunes script to see what tracks it couldn't find lyrics for.

    Out of my 2500 track library, it didn't find lyrics for about 150...pretty good if you ask me...

    ***What I want to do is combine the "No Lyrics to Playlist" script, the script that I wrote above, and the "Clean No Lyrics Playlist" scripts, so that it would be a "set it and forget it" solution, one click and walk away...

    However if I try to launch Get Lyrical from an iTunes Script(as in from the iTunes menubar) then Get Lyrical just immediately freezes up...***

    Note: Such a script would be for personal use, and if shared, I would certainly get permission from the scripts creators first.

Share This Page