Skip to content

Instantly share code, notes, and snippets.

@Spacerat
Last active March 23, 2016 16:28
Embed
What would you like to do?
AppleScript to remove items from iTunes whose files have been deleted
tell application "iTunes"
set selectedTracks to selection
repeat with i from 1 to (length of selectedTracks)
if class of item i of selectedTracks is not shared track then
tell item i of selectedTracks to set {loc} to {get location}
if loc is missing value then
tell application "iTunes"
delete item i of selectedTracks
end tell
end if
end if
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment