(* This script is an adaptation of Doug Adams' "Lyrics to TextEdit" for iTunes (http://www.dougscripts.com/itunes/) and Apple's own "Clipboard to iPod Note" script (http://www.apple.com/applescript/ipod/). I used both concepts and script lines from both, but the overall script is my own. It does the following: *Checks for a mounted iPod, and prompts for a selection if more than one iPods are found. *Takes the lyrics (if any) for the currently playing track (if playing) or the currently selected track[s] (if iTunes is not playing) and converts them to an iPod compatible note, complete with a "Play Song" hyperlink. *If a mounted iPod is found, it will transfer the lyrics note[s] to the iPod in a subfolder of the Notes folder called Lyrics (you must create this). *Within the Lyrics folder, it will check for a folder named for the artist of each track--this is where the lyrics note[s] will actually reside for each artist. If no artist folder is found for the track's artist, it will create it. No warranty is given or implied. Use at your own risk. *) tell application "iTunes" if player state is playing then set sel to current track as list else if selection is not {} then set sel to selection end if repeat with this_track in sel set {art, nom} to {this_track's artist, this_track's name} set the_string1 to "Play Song
" set the_lyrics to this_track's lyrics set file_name to (art & "-" & nom) -- check for iPods set the mounted_iPods to my locate_iPods() -- check for iPod count if the mounted_iPods is {} then error "No iPod is connected to this computer." else if the (count of the mounted_iPods) is greater than 1 then -- choose iPod set the ipod_names to {} repeat with i from 1 to the count of the mounted_iPods set this_iPod to item i of the mounted_iPods tell application "Finder" set the end of the ipod_names to the name of this_iPod end tell end repeat set this_name to (choose from list ipod_names with prompt "Pick the iPod to use:") as string if this_name is "false" then error number -128 repeat with i from 1 to the count of the ipod_names if item i of the ipod_names is this_name then set this_iPod to item i of the mounted_iPods exit repeat end if end repeat else set this_iPod to item 1 of the mounted_iPods end if set artist_folder to art as string set l_folder to this_iPod & "Notes:" & "Lyrics:" as Unicode text tell application "Finder" if not (folder (l_folder & artist_folder) exists) then make new folder at l_folder with properties {name:artist_folder} end if set the the_path to folder (l_folder & artist_folder) end tell if the_lyrics is not "" then set this_data to {the_string1 & nom & the_lyrics} as string set target_file to (the_path as string) & file_name set openTargetFile to open for access file target_file with write permission write this_data to openTargetFile close access openTargetFile -- end tell else beep end if end repeat end tell on locate_iPods() set the volumes_directory to "/Volumes/" as POSIX file as alias set the volume_names to list folder volumes_directory without invisibles set mounted_iPods to {} repeat with i from 1 to the count of volume_names try set this_name to item i of volume_names set this_disk to ("/Volumes/" & this_name & "/") as POSIX file as alias set these_items to list folder this_disk if "iPod_Control" is in these_items then set the end of the mounted_iPods to this_disk end if end try end repeat return mounted_iPods end locate_iPods