FasdUAS 1.101.10 k l  A script that will duplicate the playlist in the frontmost window from a shared library into your library. If the playlist contains songs that are NOT in your library, a dialog will be displayed after importing that will tell you the number of tracks that are included in the playlist but do not exist in your library. Note: This script can also be used to duplicate a regular playlist (ie: a playlist in your library), but it is not the most efficient way of doing so. 2005 davidfmiller http://www.fivevoltlogic.com v1.0.1 March 10, 2005 - modified playlist prefix and improved documentation v1.0 January 3, 2005 - initial release  l  l  l hb how long the "missing tracks" dialog box should be displayed before being automatically dismissed  j 0_give_up_GIVE_UP m l l E? modifiers for the name of the duplicated playlist (if desired) j 0_prefix_PREFIX m copy of  j 0_suffix_SUFFIX m  l !" !l(# #O($% $k'&&'( 'l()* )r +, +n -. -1  pPly .4/  cwin /m ,o 0mylist*01 0l 2 2?9 make sure the selection is a playlist before proceeding 134 3Z %567 5l 8 8= 9: 9c ;< ;n => =m  pcls >o  0mylist <m  TEXT :m? ? user playlist 6n@A @IB 0copysharedlistcopySharedListBC Co 0mylist Af 7I %D .sysodlogaskrTEXT Dl !E Em !F F+%Please select a playlist to duplicate4G Gl&& %mHHnull߀ iTunes.app؀!@ؠP)X( l`hookalisN stepchild H+ iTunes.app+ Mediaoq ^'stepchild:Applications:Media:iTunes.app iTunes.app stepchildApplications/Media/iTunes.app/"IJ IlJKL KlLMN Mi OP OIQ 0copysharedlistcopySharedListQR Ro 0mylist POST SkUUVW VlWXY XlZ Z3- get the info for the playlist to be importedY[\ [r ]^ ]l_ _n`a `2  cTrk ao 0mylist ^o 0mytracks\bc br de dl f fn gh g1  pnam ho 0mylist eo 0mynamecij iljkl klm m.( by default we aren't missing any trackslno nrpq pm qo 0 missingtracks missingTracksors rlstu tlv v:4 create a new list with " copy" appended to the nameuwx wr.yz yI,{ .corecrel****null{|}  kocl |m  cPly}~  prdt ~K(  pnam b& b o 0_prefix_PREFIX o 0myname o % 0_suffix_SUFFIX zo 0mylistx l// l// \V loop through all tracks, adding them to the new playlist if they exist in our library X/k k?f r?O n?M I@M 0gettrackgetTrack n@C 1AC  pArt o@A 0i nCF 1DF  pAlb oCD 0i nFI 1GI  pnam oFG 0i f?@ o 0mytrack lPP  if the track exists ZPf lPS >PS oPQ 0mytrack mQR  boovfals IV^ .coreclon******** oVW 0mytrack  insh nXZ ;YZ oXY 0mylist kaf laa 60 increase the number of missing tracks to report raf [ad oab 0 missingtracks missingTracks mbc o 0 missingtracks missingTracks 0i o23 0mytracks lll lll D> display a dialog if some tracks were not found in our library Zl llo >lo olm 0 missingtracks missingTracks mmn kr lrr lrr (" if there's only 1 missing song... Zr lru =ru ors 0 missingtracks missingTracks mst kx Ix .sysodlogaskrTEXT lx bx bx bx bx{ mxy  oyz 0 missingtracks missingTracks m{~  song in the playlist " o~ ~ 0myname m 71" was not imported because it could not be found.} } btns m OK| | givu o{ {0_give_up_GIVE_UPz z dflt m OKyx y disp mw w sticx lvuvut lss 3- or if there's more than 1 missing song... t Ir r.sysodlogaskrTEXT lq b b b b m  op p0 missingtracks missingTracks m  songs in the playlist " oo o 0myname m :4" were not imported because they could not be found.qn n btns m OKm m givu ol l0_give_up_GIVE_UPk k dflt m OKji j disp mh h stici TmHN lgfgf le e  returns a track from our library that matches the artist, album, and name that are passed as parameters; or false, if no such track exists   d  i    Icb c0gettrackgetTrack oa a 0_artist o` ` 0_album_ o^ ^ 0_track_b  OB kA l]\]\ l[[ *$ search for the track in our library r) 6' !  n "# "2 Z Z cTrk #4Y$ Y cPly $mXX !l &%W %F &&' &F () (= *+ *1V V pArt +oU U 0_artist )=,- ,1T T pAlb -oS S 0_album '=%./ .1!R R pnam /o"$Q Q 0_trackW oP P 0mytrack01 0l**ONON123 2l**M4M 4*$ if the track exists, then return it356 5Z*?78L9 7l*/:K :=*/;< ;n*-=> =1+-J J leng >o*+I I 0mytrack <m-.HHK 8k2:??@A @L28B Bn27CD C436GE G cobj Em45FF Do23E E 0mytrackAFD Fl99CGC G?9 otherwise return false to indicate that it doesn't existDL 9L=?H Hm=>B B boovfals6IA Il@@@?@?A mHd>J=KLM>J<;:987 <0_give_up_GIVE_UP ;0_prefix_PREFIX :0_suffix_SUFFIX 9 0copysharedlistcopySharedList 80gettrackgetTrack 7.aevtoappnull****=K6P54NO3 6 0copysharedlistcopySharedList52P2P1 1 0mylist4N0/.-,+ 0 0mylist / 0mytracks . 0myname -0 missingtracks missingTracks ,0i + 0mytrackO H*)('&%$#"!  * cTrk ) pnam ( kocl ' cPly & prdt% $.corecrel****null # cobj ".corecnte******** ! pArt  pAlb 0gettrackgetTrack  insh .coreclon********  btns  givu  dflt  disp  stic .sysodlogaskrTEXT3۠-EO,EOjEO*b%b%l EO;[l kh),,,m+ EOf 6l YkE[OYOjlk4%a%%a%aaabaaaaa OPY1a%a%%a%aaabaaaaa YhUL QR 0gettrackgetTrackSS  0_artist  0_album  0_trackQ 0_artist 0_album 0_track 0mytrackR H T  cPly  cTrkT  pArt  pAlb  pnam  leng  cobjC?*k/-[[[,\Z8\[,\Z8A\[,\Z8A1EO,k k/EOPYfOPUMUVW .aevtoappnull**** Uk(XX!VW H?F  cwin  pPly 0mylist  pcls  TEXT 0copysharedlistcopySharedList .sysodlogaskrTEXT)%*k/,EO,& )k+Yj OPUascr ޭ