Monthly Archives: February 2012

Delete Playlists AppleScript

I put together an AppleScript snippet to delete playlist files anywhere under the current directory. Some CD ripping software and music sharing sites include playlist files (*.m3u, *.pls) alongside audio files; if you drag a folder with audio files and playlist files, iTunes adds duplicate copies of the tracks. Solution: save this script as an application and drag it into your Finder toolbar; then run the app on the parent directory before you drag your new music into iTunes.

Basically it’s just running this command on your top-level Finder folder:

find $TARGET_DIR \( -name \*.pls -or -name \*.m3u \) -exec rm -f {} \;

Here’s the code; paste this into AppleScript Editor and save as an application, then you can drag it to your Finder toolbar (or wherever is a convenient place for you to launch it):