I've slightly modified Doug's "Lyrics via Lyrics wiki" script so that it automatically crawls through the entire Library (or current playlist) in iTunes, gets and saves lyrics for each tracks.
You can view the lyrics by using the "Get Info" command on a track. If you want to use it, open Script Editor and copy the following script into it.
Open iTunes, play the first track in the Library. (You may also mute the volume at the this time). Then go back to script editor, click Compile, and then click Run.
iTunes should now begin gathering lyrics for your tracks. It took me about 7 minutes to get lyrics for 410 items. iTunes was working, visible but irresponsive. So keep that in mind.
Finally, it might throw some errors if the lyrics server is being irresponsive. So don't worry and just click OK.
SCRIPT:
Have fun.
You can view the lyrics by using the "Get Info" command on a track. If you want to use it, open Script Editor and copy the following script into it.
Open iTunes, play the first track in the Library. (You may also mute the volume at the this time). Then go back to script editor, click Compile, and then click Run.
iTunes should now begin gathering lyrics for your tracks. It took me about 7 minutes to get lyrics for 410 items. iTunes was working, visible but irresponsive. So keep that in mind.
Finally, it might throw some errors if the lyrics server is being irresponsive. So don't worry and just click OK.
SCRIPT:
Code:
(*
"Collect Lyrics for All Tracks" for iTunes
A Modified version of "Lyrics via LyricWiki" for iTunes written by Doug Adams
dougadams@mac.com
Thanks to the many Correspondents who emailed me info on the SOAP command.
<http://lyricwiki.org/LyricWiki_talk:SOAP>
v1.0 February 28 2009
-- initial release
Get more free AppleScripts and info on writing your own
at Doug's AppleScripts for iTunes
http://dougscripts.com/itunes/
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Get a copy of the GNU General Public License by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
or visit http://www.gnu.org/copyleft/gpl.html
*)
property my_title : "Lyrics via LyricWiki"
property nom : ""
property art : ""
global sel
repeat
tell application "iTunes"
if player state is playing then
set sel to current track
tell sel to set {nom, art} to {get name, get artist}
else if selection is not {} and (count items of selection) is 1 then
set sel to item 1 of selection
tell sel to set {nom, art} to {get name, get artist}
else
return
end if
end tell
log {nom, art}
try
tell application "http://lyricwiki.org/server.php" to set rez to (call soap {method name:"getSong", method namespace uri:"urn:LyricWiki", SOAPAction:"urn:LyricWiki#getSong", parameters:{artist:art as text, song:nom as text}})
on error m
tell application "iTunes"
display dialog "Error from LyricWiki:" & return & return & tab & m with title my_title
end tell
end try
-- log rez
set theLyrics to (lyrics of rez) as text
set lyricWikiPageURL to |url| of rez
log theLyrics
-- copy to lyrics or display LyricsWiki page?
if theLyrics does not contain "Not found" then
set displayLyrics to my text_to_list(theLyrics, (ASCII character 10))
tell application "iTunes"
try
set sel's lyrics to theLyrics
end try
end tell
end if
tell application "iTunes"
next track
end tell
end repeat
on text_to_list(txt, delim)
set saveD to AppleScript's text item delimiters
try
set AppleScript's text item delimiters to {delim}
set theList to every text item of txt
on error errStr number errNum
set AppleScript's text item delimiters to saveD
error errStr number errNum
end try
set AppleScript's text item delimiters to saveD
return (theList)
end text_to_list
Have fun.