FasdUAS 1.101.10 k l E? This script creates a new playlist called "Duplicate Tracks."  l  GA It then starts at the selected track (or beginning) and compares  l  KE the name of the track to the name of the next track. If they match,  l KE the user can play the track, which shows it in iTunes, then the user l ?9 can add the track to the "Duplicate Tracks" playlist*.  l l IC Alternatively, all duplicates can be put in the "Duplicate Tracks" l # playlist without confirming. l l  JD *NOTE: Opton-Delete on the songs in the "Duplicate Tracks" playlist!" !l# #60 will then delete them from the library as well."$% $l%&' &l( (UO This is somewhat of a hack given my primitive applescript knowldege. It would')* )l+ +2, be nice to make the following improvements:*,- ,l-./ .l0 0=7 1) Find the number of the selected track more quickly./12 1l3 3IC 2) Offer an option to delete the track after the user plays it, or245 4l6 6]W to delete the NEXT track. (doable, given the iTunes "Delete Selected Track Files"578 7l9 90* script, but I just haven't done it.)8:; :l;<= <l> >" Brian Hargreaves, Jan 2005.=?@ ?l@AB AlBCD ClDEF ElG GrHI HmJ JDuplicate Tracks Io 0 dupplnameFKL KlM MrNO Nm Oo 0 duplicate_onLPQ Pl R Rr ST Sm  To 0 maxdurdiffQUV UlVWX WlXYZ Yj[ 0required_version [m\ \ 2.0.3Z]^ ]l^_` _l a aO bc bkddef eI .miscactvnullnullfgh glhij ilk kGA If there is a track selected in the Library, start at that trackjlm lln nD> by first getting its name. Later we'll find the number of itmop olq q in the list.prs rlstu trvw vlx xnyz y1  sele z4{  cBrW {m wo 0selectedtracksu|} |Z`~ ~=# o 0selectedtracks J " k&A r&) m&' o 0startnum I*A .sysodlogaskrTEXT b*= b*; b*9 b*7 b*5 b*3 b*1 b*/ b*- m*+ /)This script will find consecutive tracks  o+,  ret m-. "with the same song name, and o/0  ret m12 put them in a playlist  o34 0 dupplname m56 . o78  ret o9:  ret m;< /)Sort Library by song name before running. kD` rDN lDJ nDJ 4EJ  cobj mHI oDE 0selectedtracks o 0 starttrack rOR mOP o 0startnum rS^ nSZ 1VZ  pnam oSV 0 starttrack o 0starttrackname l__ l__ :4 display dialog "Current track is " & starttrackname} laa laa laa ?9 Figure out if the duplicate playlist exists by comparing laa .( dupplname to the name of all playlists. laa raf mab o 0 existingduppl Yg ky ry ny 1  pnam 4y  cPly o}~ 0i o 0plname l 0* display dialog "Playlist name: " & plname Z = o 0plname o 0 dupplname k r m o 0 existingduppl I .sysodlogaskrTEXT b b b b b m Duplicate playlist exists. o  ret o  ret m & You may wish to remove or clear  o  ret m +%the playlist and restart this script. r 4  cPly o 0i o 0 dup_playlist 0i mjk lkt lkt Ikt .corecnte******** 2kp~ ~ cPly l}|}| l{{ ;5 If duplicate playlist doesn't exist, then create it. lzyzy Zxw lv = ou u0 existingduppl mttv k r   Isr s.corecrel****nullr q p q kocl  mo o cPlyp  on n0 dup_playlist m r ol l 0 dupplname lk n 1j j pnam oi i0 dup_playlistkmxw lhghg lfefe ldd ,& Prompt for mode - confirm or add all. lcbcb Ia a.sysodlogaskrTEXT b!" !b#$ #b%& %b'( 'm) )+%Confirm individual selections before  (o` ` ret &m* * adding to  $o_ _ 0 dupplname "m+ + playlist? ^,] ^ btns ,J--./ .m0 0 Yes/12 1m3 3No24\ 4m5 5 Cancel\]67 6r89 8n:; :1 [ [ bhit ;l  =Z'?@WV ?lAU A=BC BoT T0 thebutton theButton CmD D YesU @r#EF EmSS FoR R0 confirm_eachWV>GH GZ(;IJQP Il(/KO K=(/LM Lo(+N N0 thebutton theButton Mm+.N NNoO Jr27OP Om23MM PoL L0 confirm_eachQPHQR Ql< > bhit rlRUs= s1RU< < rslt=? omY\t t Yes lr`euv um`a;; vo: :0check_duration@ mrhmwx wmhi99 xo8 80check_durationjyz ylnn7676z{| {On}~ }Oy~ k} r l5 l4 I32 3.corecnte******** 21 1 cTrk245 o0 0 0 numtracks l/./. l-- @: Find starting track by comparing names. This is probably l,, )# not the fastest way to do this...! l+*+* Z)( l' = o& & 0startnum m%%' Y$# k r n 1" " pnam 4! ! cTrk o 0i o  0reftrack P Z = o  0reftrack o 0starttrackname k r o 0i o  0startnum r o  0 numtracks o 0i  conscase  conspunc $0i m l o  0 numtracks#)( l    l  3- display dialog "Start number is " & startnum l    l 93 Go through all tracks, comparing each to the next. l r m o  0durdiff Y{ kv r n 1  pnam 4  cTrk o 0i o 0reftrack r l [ o 0i m o 0j r n 1  pnam 4  cTrk o  0j o 0 thistrack Zg l = o 0check_duration m k c r . n * 1&*  pDur 4 &  cTrk o$% 0i o 0 reftrackdur r/? n/; 17;  pDur 4/7  cTrk o36 0j o 0 thistrackdur Z@c l@G ?@G o@C 0 reftrackdur oCF 0 thistrackdur rJU \JQ oJM 0 reftrackdur oMP 0 thistrackdur o 0durdiff rXc \X_ oX[ 0 thistrackdur o[^ 0 reftrackdur o 0durdiff lhh Phv   kou     loo  loo @: Compare track names to each other. If they are the same, loo A; then either confirm to play, then ask to add, or just add. loo Zou Fo lov =ov oor 0 thistrack oru 0reftrack ly~ Ay~ oy| 0durdiff  o|} 0 maxdurdiff kq!!"# "Zo$%& $l' '=() (o 0 confirm_each )m %kI**+, +I-. .sysodlogaskrTEXT -b/0 /b12 1b34 3m5 5Duplicate names:  4o 0reftrack 2m6 6  and  0o 0 thistrack.78  btns 7J99:; :m< < Next;=> =m? ? Play>@ @mA A Cancel8B  dflt Bm,CD CrEF ElG GlH HnIJ I1  bhit JlK K1  rslt Fo 0 thebutton theButtonDL LZIMN M=OP Oo 0 thebutton theButton PmQ Q Play NkERRST SrUV U4W  cTrk Wo 0i Vo 0 playtrackTXY XIZ .hookPlaynullobj Zo 0 playtrackY[\ [I]^ .sysodlogaskrTEXT ]b_` _bab abcd cbef ebgh gbij ibkl kmm mPlaying  lo 0reftrack jmn n. ho  ret fo  ret dmo o Add to  bo 0 dupplname `mp p Playlist?^qr  btns qJsstu tmv v Yesuwx wmy yNoxz zm{ { Cancelr|  dflt |m \} }ZE~ ~= l n 1  bhit l 1  rslt m  Yes kA I. .coreclon******** l$ 4$  cTrk o"# 0i  insh o'* 0 dup_playlist I/A .coreclon******** l/7 4/7  cTrk o36 0j  insh o:= 0 dup_playlist &kLo IL\ .coreclon******** lLR 4LR  cTrk oPQ 0i  insh oUX 0 dup_playlist I]o .coreclon******** l]e 4]e  cTrk oad 0j  insh ohk 0 dup_playlist# lpp~}~} | | conscase{z { conspuncz 0i oy y 0startnum lx \ ow w 0 numtracks mvvxu l||tstsu 4yr r cPly m}  Library ~4nvq q cSrc mru  Library|p Ion o.sysodlogaskrTEXT b b b b b b b b b m Search Complete. om m ret ol l ret m #Use option-delete on selected ok k ret m tracks in the  oj j 0 dupplname m  playlist oi i ret m ("will remove them from the library.np cm null iTunes.app0L70D)$(K PIhookalisL Macintosh HD,H+ iTunes.app?輬#X Applications-/4 $Macintosh HD:Applications:iTunes.app iTunes.app Macintosh HDApplications/iTunes.app/` lhghgf lededfc\cba b0required_version a.aevtoappnull****`_^] `.aevtoappnull**** kEKP_\\_^[ [0iYJZYXWVUTSRQPONMLKJIHGF)*+E035DCBDAN^cfht@?>=<;:9876556<?A43Q21mnopvy{0/ Z 0 dupplname Y0 duplicate_on X0 maxdurdiff W.miscactvnullnull V cBrW U sele T0selectedtracks S 0startnum R ret Q.sysodlogaskrTEXT P cobj O0 starttrack N pnam M0starttrackname L0 existingduppl K cPly J.corecnte******** I 0plname H0 dup_playlist G kocl F.corecrel****null E btns D rslt C bhit B0 thebutton theButton A0 confirm_each @0check_duration ? cSrc > cTrk = 0 numtracks < 0reftrack ; 0durdiff :0j 9 0 thistrack 8 pDur 70 reftrackdur 60 thistrackdur 5 bool 4 dflt3 2 0 playtrack 1.hookPlaynullobj 0 insh /.coreclon********]EOjEOmEO*j O*k/,EOjv kEO%%%%%%%%%j Yak/E`OjEO_a,E`OPOjE`OWk*a-j kh*a/a,E`O_+kE`Oa%%a%%a%j O*a/E`Yh[OYO_j*aal E`O_a,FYhOa%a %%a!%a"a#a$a%mvl O_&a',E`(O_(a) kE`*YhO_(a+ jE`*YhOa,a"a-a.a/mvl O_&a',a0 kE`1YjE`1O*a2a3/*aa4/*a5-j E`6OjD>k_6kh*a5/a,E`7Oga8_7_EO_6EYhV[OYYhOjE`9O_6kkh*a5/a,E`7OkE`:O*a5_:/a,E`;O_1kH*a5/a<,E`=O*a5_:/a<,E`>O_=_>_=_>E`9Y _>_=E`9YhOga8 _;_7 _9a?&_*ka@_7%aA%_;%a"aBaCaDmvaEkaF O_&a',E`(O_(aG*a5/E`HO_Hj IOaJ_7%aK%%%aL%%aM%a"aNaOaPmvaEkaF O_&a',aQ(*a5/aR_l SO*a5_:/aR_l SYhYhY%*a5/aR_l SO*a5_:/aR_l SOPYhV[OYtOPUUOaT%%aU%%aV%%aW%%aX%j Uascr ޭ