FasdUAS 1.101.10 k l  "tuneTag playtag script" written by Chris Brown: chrisbro@gmail.com http://christopholis.com and Jesse Newland: jnewland@gmail.com http://jnewland.com TuneTag By Chris Brown chrisbro@gmail.com This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. More information can be found at http://creativecommons.org/licenses/by-nc-sa/2.5/ . v1.0, january 2006 inital release v1.0q, June 2006 by Scott Wallace - swallacepdx@gmail.com a fork of the original 'playtag' script by Chris Brown and Jesse Newland this version, 'querytunes' allows more general searching using logical operations over tuneTag tags and artists names. Note currently, artist names must be a single word... v1.1q June 2006 by Scott Wallace - swallacepdx@gmail.com I couldn't help myself...I had to add a few more features. Now you can search over more than just the Tags, a:, b:, n: g:, *: so queries like "*:cheese" will do just about the same thing as the search in iTunes but things like "*:cheese or *:string" will do much more also, you can now put parenthesis in the expression so (a:tricky and a:bjork) or g:trip-hop is legal  l  l  w i I .DAEDopntTEXTTEXT o 0 thestring theString kO O  r  l  e  n  1  pnam 2  prcs o 0 running_apps mnull߀ System Events.app`/dӀP4)v(_[xӰ`sevsalis Macintosh HDH+ System Events.appjoco CoreServices(Gc :Macintosh HD:System:Library:CoreServices:System Events.app$System Events.app Macintosh HD-System/Library/CoreServices/System Events.app/ Z!" !E#$ #o 0 running_apps $m% % iTunes "r&' &m  boovtrue 'o &0itunes_is_runningiTunes_is_running ( (ZO)*+ )o &0itunes_is_runningiTunes_is_running *O =,- ,k$<../0 /I$) .miscactvnullnull01 1Z*<234 2=*-56 5o*+ 0 thestring theString 6m+,7 7 3I0;89 .sysodlogaskrTEXT 8m01: :C=No text entered. Please enter one or more tags and try again.9;<  btns ;J25==> >m23? ?OK<@  dflt @m67 4k><AABC BI>EDE .sysodlogaskrTEXT Dm>?F F("Enter a name for the new playlist.EG  dtxt Gm@AH HCIJ IrFOKL KnFMMN M1IM  ttxt N1FI  rslt Lo "0newplaylistnamenewPlaylistNameJOP OZP~QR QlPZS SIPZT .coredoexboolobj T4PVU  cPly UoTU "0newplaylistnamenewPlaylistName Rk]zVVWX WI]oYZ .sysodlogaskrTEXT Ym]`[ [3-That playlist name already exists. Overwrite?Z\]  btns \Jai^^_` _mada a Cancel`b bmdgc cOK]d  dflt dmjkXe eIpzf .coredelonullobj f4pvg  cPly gotu "0newplaylistnamenewPlaylistNamePhi hrjk jll lIm .corecrel****nullmno  kocl nm  cUsPop  prdt pKqqrs  pnam ro "0newplaylistnamenewPlaylistNamest  pShf tm  boovtrue ko 0 newplaylist newPlaylistiuv ulvwx wly y82 Build the query string from the quicksilver text xz{ zr|} |m~ ~ }o 0query{ r m  boovfals o 0debug r m  boovfals o 0endparenendParen X k r c o 0tl m  ctxt o 0tl r I .corecnte******** o 0tl o 0ltl l l `Z apparently AppleScript has no continue statement, so this loop is a bit ugly...  Z = o 0tl m *dbg* k r m  boovtrue o 0debug r m  o 0tl l l apparently AppleScript doesn't like setting to illegal boundaries i.e. set tl to (text 2 thru 1 of tl) ... so we need to explicitly test that the paren is not alone  ZK C o 0tl m ( k r b o 0query m  (  o 0query Z = o 0tl m ( r m  o 0tl r l n 7   ctxt m o 0ltl o 0tl o 0tl D o 0tl m ) k"G Z"C ="' o"# 0tl m#& ) r*/ m*-  o 0tl r2C l2A n2A 73A  ctxt m9; l<@ \<@ o=> 0ltl m>? o23 0tl o 0tl rDG mDE  boovtrue o 0endparenendParen lLL~}~} ZL =LQ oLM| |0tl mMP  lTT{{  do nothing! GXu GXi =X] oXYz z0tl mY\  and =`e o`ay y0tl mad or =lq   olmx x0tl  mmp  not   rx bx bx bx} oxyw w 0query my|   o}~v v0tl m   ou u 0query  C ot t0tl m t: k !  r"# "Is$r s.corecnte******** $oq q0tlr #op p0ltl!%o %r&' &b() (b*+ *b,- ,on n 0query -m. .(c contains "* +l/m /n01 07l23 l ctxt 2mkk 3oj j0ltl 1oi i0tlm )m4 4") 'oh h 0queryo56 5C78 7og g0tl 8m9 9a:6:; :k<<=> =r?@ ?IfAe f.corecnte******** Aod d0tle @oc c0ltl>Bb BrCD CbEF EbGH GbIJ Ioa a 0query JmK K (a contains " HlL` LnMN M7_OP _ ctxt Om^^ Po] ]0ltl No\ \0tl` FmQ Q") Do[ [ 0queryb;RS RCTU ToZ Z0tl UmV Vb:SWX Wk YYZ[ Zr\] \IY^X Y.corecnte******** ^oW W0tlX ]oV V0ltl[_U _r `a `bbc bbde dbfg foT T 0query gmh h (b contains " eliS injk j7Rlm R ctxt lmQQ moP P0ltl koO O0tlS cmn n") aoN N 0queryUXop oC qr qo  M M0tl rm s sn:ptu tk5vvwx wryz yIL{K L.corecnte******** {oJ J0tlK zoI I0ltlx|H |r5}~ }b3 b/ b! oG G 0query m   (n contains " l!.F n!. 7".E E ctxt m(*DD o+-C C0ltl o!"B B0tlF m/2 ") ~oA A 0queryHu C8= o89@ @0tl m9< g: k@a r@G I@E?> ?.corecnte******** o@A= =0tl> o< <0ltl; rHa bH_ bH[ bHM oHI: : 0query mIL  (g contains " lMZ9 nMZ 7NZ8 8 ctxt mTV77 oWY6 60ltl oMN5 50tl9 m[^ ") o4 4 0query; Cdi ode3 30tl meh *:2 kl rls Ilq10 1.corecnte******** olm/ /0tl0 o. .0ltl- rt bt bt bty otu, , 0query mux (star contains " ly+ ny 7z* * ctxt m)) o( (0ltl oyz' '0tl+ m ") o& & 0query-2 r b b b o% % 0query m (c contains "* o$ $0tl m ") o# # 0query l"!"! l   Z o 0endparenendParen k r b o  0query m   )  o  0query r m  boovfals o 0endparenendParen l 0tl n I  0split o 0 thestring theString m   f l l    Z o 0debug I .sysodlogaskrTEXT b m  Query: o  0query  btns J m OK  dflt m   l r b b b b   m  VPrepeat with t from 1 to count of every file track of library playlist 1 set aTrax to (file track t of library playlist 1) set c to comment of aTrax set a to artist of aTrax set b to album of aTrax set n to name of aTrax set g to genre of aTrax set star to c & " " & a & " " & b & " " & n set store to false ignoring case if   o 0query m  jd then set store to true end if end ignoring if store then duplicate aTrax to playlist " o "0newplaylistnamenewPlaylistName m  " end if end repeat o 0 metascript metaScript l Q I .sysodsct****scpt o 0 metascript metaScript R .ascrerr ******** o 0errormsgerrorMsg  errn o 0errornumerrorNum I .sysodlogaskrTEXT b b b b!" !b#$ #m% % Error  $o 0errornumerrorNum "m& &:  o  ret o  ret o 0errormsgerrorMsg'(  btns 'J ))* *m  + +OK(,-  dflt ,m-.  disp .m  stic/0 /l012 1r.34 34#5  cPly 5o!" "0newplaylistnamenewPlaylistName 4n67 61)-  pPly 74#)8  cwin 8m'(29 9I/<: .hookPlaynullobj :l/8; ;5/8<  cPly <o34 "0newplaylistnamenewPlaylistName  kfrmname -m !==null iTunes.appPZ`/{pPD)v(_[xҠ`hookalisL Macintosh HDH+ iTunes.app8R? Applications(G$Macintosh HD:Applications:iTunes.app iTunes.app Macintosh HDApplications/iTunes.app/ +I@O>? .sysodlogaskrTEXT >m@C@ @?9iTunes is not running. Please start iTunes and try again.?AB  btns AJDICCD DmDGE EOKBF  dflt FmJKnull߀Quicksilver.app`/[P`}P0\1 dրDdaedalis` Macintosh HDH+Quicksilver.app k8U Applications(G)Macintosh HD:Applications:Quicksilver.app Quicksilver.app Macintosh HDApplications/Quicksilver.app/ GH GlHI IiJK JIL 0splitLMN Mo 0sometextsomeTextNO Oo 0 delimiter KkPPQR QrST So 0 delimiter TnUV U1  txdl V1  ascrRWX Wr YZ Yn [\ [2  citm \o 0sometextsomeText Zo 0sometextsomeTextX]^ ]r _` _J aab bm c c `nde d1  txdl e1  ascr^f fLg go 0sometextsomeTexthijh .DAEDopntTEXTTEXT 0splitikl .DAEDopntTEXTTEXT 0 thestring theStringk 0 thestring theString 0 running_apps &0itunes_is_runningiTunes_is_running "0newplaylistnamenewPlaylistName 0 newplaylist newPlaylist 0query 0debug 0endparenendParen 0tl 0ltl 0 metascript metaScript 0errormsgerrorMsg 0errornumerrorNuml]%=7:?FH[ac~ .49KQVhns   m%&+@E  prcs  pnam .miscactvnullnull  btns  dflt .sysodlogaskrTEXT  dtxt  rslt  ttxt  cPly .coredoexboolobj .coredelonullobj  kocl  cUsP  prdt  pShf .corecrel****null 0split  cobj .corecnte********  ctxt  bool .sysodsct****scpt 0errormsgerrorMsgm  errn 0errornumerrorNum  ret  disp  stic  cwin  pPly  kfrmname .hookPlaynullobj P *-,EEUOeEYhO"*j Okvk Yl O_a,EO*a/j "aaalvl O*a/j YhO*aaaae EOaEOfEOfEO)al+[aa l !kha"&EOj !EOa#eEOa$EYhOa%,a&%EOa' a(EY[a"\[Zl\Z2EY3a)*a* a+EY[a"\[Zk\Zk2EOeEYhOa,hYGa- a.a/& a0a/&a1%%a2%EYa3&j !EOa4%[a"\[Zm\Z2%a5%EYa6&j !EOa7%[a"\[Zm\Z2%a8%EYa9&j !EOa:%[a"\[Zm\Z2%a;%EYa<&j !EOa=%[a"\[Zm\Z2%a>%EYga?&j !EOa@%[a"\[Zm\Z2%aA%EY;aB&j !EOaC%[a"\[Zm\Z2%aD%EYaE%%aF%EOaG%EOfEYhOP[OY OaH%aIkvk YhOaJ%aK%%aL%EO j MW.XNOaP%aQ%_R%_R%%aSkvkaTaUaV O*a/*aWk/aX,FO*aaY0j ZUYa[a\kvk jKno 0splitpp 0sometextsomeText 0 delimitern 0sometextsomeText  0 delimitero~}|c ~ ascr } txdl | citm,FO-EOkv,FOascr ޭ