Remove missing and broken music in iTunes using this little applescript

February22

missinglink1

Do you ever get annoyed that your music in your iTunes library has an old broken link? Well this little AppleScript will search your iTunes library and delete any of the alias’ that don’t have a music file attached to it.

Nice and simple.

1 – Open Apple Script Editor (start typing AppleScript into spotlight)

2 – Copy and paste the below code into your new window and click Run

3 – Save the script for using again in the future

tell application “iTunes”

set thePlaylist to library playlist 1
set musicFiles to the file tracks of thePlaylist

repeat with mf in musicFiles
--the name of mf as string
set hasLoc to ""
if (the location of mf as string ¬
is equal to "missing value") then
try
set comment of mf to the comment of mf & ""
on error number errNum
delete mf
end try

end if
end repeat
end tell

itunes_script

posted under Apple

Email will not be published

Website example

Your Comment:

Profile

Chad in Frame

chadsayshello.com is the blog of
Chad Durham - an independent graphic designer (and director of Big Hello Design) working in London and now living on the south coast. Please contact me if you have a design project, a link suggestion or just want to say hello.

Chad Durham on Twitter

Big Hello Design
Big Hello on Twitter
Chad Durham on LinkedIn
Chad's Work Availability
Chad's Flickr-roll
Our Wedding Site
Chad's sites
Space CAM!
Essential Design Handbooks

Twitterings

Recent Posts

Categories

Archives