iTunes Scripts

random scripts that interface with iTunes 

exit_itunes ( VBS )

itunes_add_m3u_playlist ( PERL | EXE )

itunes_album_playlists ( PERL | EXE )

itunes_artist_album_listing ( PERL | EXE )

itunes_backup_playlists ( PERL | EXE )

itunes_find_by_location ( PERL | EXE )

itunes_info ( PERL | EXE )

itunes_insert_artwork (PERL | EXE | VBS)

itunes_ipod_playlist ( PERL | EXE )

itunes_ipod_playlist_to_itunes ( PERL | EXE )

itunes_preferences_fix ( PERL | EXE )

( PERL | EXE )

itunes_remove_by_location ( PERL | EXE )

itunes_remove_by_playlist ( PERL | EXE )

itunes_remove_duplicates ( PERL | EXE | VBS )

itunes_remove_notfound ( PERL | EXE | VBS )

itunes_update_info ( PERL | EXE )

itunes_vidkind ( PERL | EXE | VBS )

iTunes_ezRate ( iTunes_ezRate.widget )

Think these are cool? Check out my iTunes Resource Hacks

These scripts interface with iTunes (for Windows only) via the COM interface. Most of them are written in Perl, but I have provided EXE versions for those that don't want or have Perl installed. I use ActiveState Perl. All of these scripts are licensed under the GNU GPL v2. Althought mosts of these scripts were tested using iTunes 6, they should work fine with iTunes 7. Scripts requiring iTunes 7 will refuse to run if you have iTunes 6.

exit_itunes ( VBS ) is a simple VB script to exit iTunes. I use it to facilitate backup of the iTunes Library files (which shouldn't be backed up when iTunes is open)

itunes_add_m3u_playlist ( PERL | EXE ) will allow you to add multiple m3u playlists to iTunes at once. You give it the directory containing the m3u files, and it does the rest. It will optionally recurse into subdirectories to find m3u files. Note that you can usually do the same without a script using Windows Explorer -- simply drag and drop them into iTunes.

itunes_album_playlists ( PERL | EXE ) creates playlists for every album it finds in your Library. You better be sure that's what you want!

itunes_artist_album_listing ( PERL | EXE ) will create a text file on your Desktop called "albumlisting.txt" which lists all the albums for each artist found in your Library.

itunes_backup_playlists ( PERL | EXE ) will backup all non-Smart playlists in iTunes to a text file (one text file per playlist). Files are placed in a subdirectory of the same location as the script called "Playlist Backups".

itunes_find_by_location ( PERL | EXE ) will find songs based on a user-provided pattern (perl regex, e.g. "\.m4p$") provided by the user. The results are placed in a new playlist called "Location".

itunes_info ( PERL | EXE ) is a replica of the iTunes multiple track info dialog, but in addition to the fields in the iTunes editor, it also lets you edit the Comment and Description fields. Also, you can use it to set 1/2-star ratings (e.g. 2.5 stars). However, you cannot use it to modify artwork (yet?).

itunes_insert_artwork ( PERL | EXE | VBS ) is for iTunes 7 only. It will take the artwork iTunes 7 downloads from the iTMS and insert it into the ID3 tags of the file. Note: You must run the VBS version from the command-line using "cscript"; e.g.

cscript itunes_insert_artwork.vbs
The perl and EXE versions prompt the user for whether to keep the extracted artwork (in the same directory as the music file), but for the VB script, you must pass an option "-k".

itunes_ipod_playlist ( PERL | EXE ) created especially for this thread on Apple Discussions. It takes all the songs on the iPod and creates a new playlist in iTunes called "iPod Songs" containing all the songs on the iPod.

itunes_ipod_playlist_to_itunes ( PERL | EXE ) will recreate selected playlists from your iPod in iTunes. The songs must already be in your Library.

itunes_preferences_fix ( PERL | EXE ) will restore the setting in iTunes so that it will ask for confirmation when deleting a non-empty playlist. NOTE: only tested with iTunes 7!

itunes_remove_all_artwork ( PERL | EXE ) has no practical purpose -- it removes all artwork from all songs in the user-specified playlist(s). It is easier to use the iTunes "Get Info" GUI on multiple songs to remove the artwork.

itunes_remove_by_location ( PERL | EXE ) will remove songs based on a user-provided pattern (perl regex, e.g. "\.m4p$") provided by the user from user-specified playlists. If you specify the Library, it will remove them from your Library.

itunes_remove_by_playlist ( PERL | EXE ) will remove all songs from your iTunes Library based on the playlist you selected. It will also optionally remove those files from your hard drive.

itunes_remove_duplicates ( PERL | EXE |VBS ) will remove duplicates from the user-specified playlist(s). Duplicates are determined by exact file/path name.

itunes_remove_notfound ( PERL | EXE |VBS ) will remove the song from the user-specified playlist(s) if the file does not exist.

itunes_update_info ( PERL | EXE ) will force iTunes to read every file in the playlist(s) you select, updating the ID3 tag info in iTunes. This script is totally unnecessary, but I wrote it before I realized an alternate way to do it. Simply select all the songs in the playlist, then right-click and select "Get Info". In the resulting dialog, just click OK without changing anything. iTunes will re-read the tags for all the songs.

itunes_vidkind ( PERL | EXE |VBS ) will let you change the video type (Movie, TV Show, or Music Video) of all the files in a selected playlist.

iTunes_ezRate ( iTunes_ezRate.widget ) is actually not a script, but a Yahoo Widget. Credit should go to this guy, for writing the original. I modified it to allow you to rate using 0-10 stars. e.g. if you rate it 5 stars, iTunes will actually show the rating as 2.5 stars.