This AppleScript will add the current track you are playing to a play list (currently named street) on your iPhone (or iPod). It will also make a backup of this added track to a playlist on the iTunes local playlists (also named street). The script also checks first if a song exists on the playlist, so as to not duplicate any tracks.
property playlistname : "street" tell application "iTunes" repeat with s in sources if (kind of s is iPod) then set the_ipod to s end repeat set doit to true set idx to (count tracks of playlist playlistname of the_ipod) repeat with i from 1 to idx set n to track i of playlist playlistname of the_ipod set n to (name of n as string) & (artist of n as string) & (album of n as string) set m to (name of current track as string) & (artist of current track as string) & (album of current track as string) if (n is m) then set doit to false set v to output volume of (get volume settings) set volume output volume 30 say "Dup file!" set volume output volume v exit repeat end if end repeat if (doit is true) then try duplicate current track to playlist playlistname of the_ipod duplicate current track to playlist playlistname end try end if end tell
Comments (0)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20091211043956523