-- attempt to use script editor to eliminate duplicates in my liobrary
--- export music loibrary
-- open music, choose songs, sort on album. disc, track, then select all songs\
-- then run the script
-- then sort on comment
-- then delete all tracks with the "suspect" comment
--
-- in this script, track number is the number in the selection, not in in album
----
--
set myComment to ""
set prevAlbum to ""
set prevTitle to ""
set prevTrack to {}
set prevDisk to {}
set prevTime to {}
tell application "Music"
set selectedTracks to selection -- run this after opening the music library, sonngs, select all
repeat with theTrack in selectedTracks
tell theTrack
set comment to "ok"
-- set sort album to "ok"
if (album = prevAlbum and disc number = prevDisk and track number = prevTrack and time = prevTime) then
set comment to "suspect"
-- set sort album to "suspect"
end if
set prevAlbum to album
set prevArtist to artist
set prevTrack to track number
set prevDisk to disc number
set prevTime to time
--return {prevAlbum, prevDisk, prevTrack, prevTime} --
--
end tell
end repeat
return {prevAlbum, prevDisk, prevTrack, prevTime} --
end tell