FasdUAS 1.101.10 k j 0p_sql m  "/usr/bin/sqlite3  p   0dbpathDBPath   p 0 g_libpath g_libPath l i I .aevtoappnull**** k n I 0 getlibpath getLibPath f r  o  ret o 0theouttheOut l  !" !O w#$ #kv%%&' &s() (1  sele )o 0theseltheSel'*+ *l+,- ,r./ .m /o 0 filesdeleted filesDeleted-01 0l123 2r$45 4b"67 6b 89 8m::;;Are you sure you want to permanently delete any referenced masters of the 9l< <I= .corecnte******** =o 0theseltheSel 7m !>>?? selected files? 5o 0 dialogmsg dialogMsg3@A @l%%ABC BI%;DE .sysodlogaskrTEXT Do%& 0 dialogmsg dialogMsgEFG  btns FJ'+HHIJ Im'(KKLL CancelJM Mm()NNOOOKGPQ  dflt Pm,-QRS  appr Rm.1TTUU2Delete Referenced MastersSV  disp Vm45CW WZ<vXY X=<GZ[ Zn<C\] \1?C  bhit ]1<?  rslt [mCF^^__OK YkJr``ab alJJbcd clJJef eKEset theSel to (get image versions of trash) -- this does not work :(fggset theSel to (get image versions of trash) -- this does not work :(dhi hlJJjk j;5set theSel to (get containers of trash) -- this worksklljset theSel to (get containers of trash) -- this worksimn mlJJnop olJJqr q60 Find SQLite Aperture Library in case we need itrss` Find SQLite Aperture Library in case we need itptu trJOvw vmJK  boovfals wo 0 libcopied libCopieduxy xrP[z{ znPW|} |1SW  psxp }oPS 0 g_libpath g_libPath {o 0libposixlibPOSIXy~ ~r\k c\g l\c b\c o\_ 0libposixlibPOSIX m_b,/Database/Library.apdb mcf  TEXT o 0libdbposixoriglibDBPOSIXOrig rl{ clw lls bls olo 0libposixlibPOSIX mor4/Database/LibraryCopy.apdb msv  TEXT o 0 libdbposix libDBPOSIX I| .ascrcmnt******** o| 0libdbposixoriglibDBPOSIXOrig l Z = o 0theseltheSel J R .ascrerr ******** m.Please select an image. l XL kG r n 1  rkrd o 0curimgcurImg o 0isrefisRef r n 1  ID o 0curimgcurImg o 0curidcurID l r n 1  pnam o 0curimgcurImg o 0curnamecurName l @: set masterName to value of other tag "FileName" of curImgt set masterName to value of other tag "FileName" of curImg l r l b b m l o 0curnamecurName m -  o 0newlinenewLine l Z = o 0isrefisRef m  boovtrue k l l D> Need to copy the database because the original will be locked| Need to copy the database because the original will be locked Z = o~ ~0 libcopied libCopied m} } boovfals k r b b b mcp l|{ n 1z z strq oy y 0libdbposixoriglibDBPOSIXOrig|{ m lxw n 1v v strq ou u0 libdbposix libDBPOSIXxw ot t0 thescript theScript I sr s.sysoexecTEXTTEXT oq q0 thescript theScriptrp r  m  o o boovtrue on n0 libcopied libCopiedp lmlkmlk r3 b/   b+   b'   b# oj j 0p_sql l"ih n" 1"g g strq of f0 libdbposix libDBPOSIXih m#&^ "select MASTERUUID from RKVERSION where UUID='  o'*e e0curidcurID  m+.'" od d0 thescript theScript r4? I4;cb c.sysoexecTEXTTEXT o47a a0 thescript theScriptb o` `0 zfileuuid ZFILEUUID l@@_^]_^] l@@\!"\ !'! ---------- Get the master's path"##B ---------- Get the master's path $% $r@]&' &b@Y() (b@U*+ *b@Q,- ,b@M./ .o@E[ [ 0p_sql /lEL0ZY 0nEL12 11HLX X strq 2oEHW W0 libdbposix libDBPOSIXZY -mMP3344Z "select IMAGEPATH from RKMASTER where UUID=' +oQTV V0 zfileuuid ZFILEUUID )mUX5566'" 'oU U0 thescript theScript%78 7r^i9: 9I^eT;S T.sysoexecTEXTTEXT ;o^aR R0 thescript theScriptS :oQ Q0 zimagepath ZIMAGEPATH8<= <ljjPONPON=>? >ljjM@AM @,& ---------- Get the master's disk nameABBL ---------- Get the master's disk name?CD CrjEF EbjGH GbjIJ Ibj{KL KbjwMN MojoL L 0p_sql NlovOKJ OnovPQ P1rvI I strq QoorH H0 libdbposix libDBPOSIXKJ LmwzRRSSd "select FILEVOLUMEUUID from RKMASTER where UUID=' Jo{~G G0 zfileuuid ZFILEUUID HmTTUU'" FoF F0 thescript theScriptDVW VrXY XIEZD E.sysoexecTEXTTEXT ZoC C0 thescript theScriptD YoB B"0zfilevolumeuuidZFILEVOLUMEUUIDW[\ [r]^ ]b_` _bab abcd cbef eoA A 0p_sql flg@? gnhi h1> > strq io= =0 libdbposix libDBPOSIX@? dmjjkkP "select NAME from RKVOLUME where UUID=' bo< <"0zfilevolumeuuidZFILEVOLUMEUUID `mllmm'" ^o; ;0 thescript theScript\no nrpq pI:r9 :.sysoexecTEXTTEXT ro8 80 thescript theScript9 qo7 70disknamediskNameost sl654654tuv urwx wbyz yb{| {b}~ }m/Volumes/ ~o3 30disknamediskName |m/ zo2 20 zimagepath ZIMAGEPATH xo1 10imgpathimgPathv l0/.0/. l-- '! Delete the reference master fileB Delete the reference master file r b b mrm l,+ n 1* * strq o) )0imgpathimgPath,+ m && echo $? o( (0 thescript theScript r I'& '.sysoexecTEXTTEXT o% %0 thescript theScript& o$ $0rmstatusrmStatus l#"!#"! r [ o 0 filesdeleted filesDeleted m o 0 filesdeleted filesDeleted l l  This is probably not required since the above displayed an error message when the rm command failed (when running through script editor). This is probably not required since the above displayed an error message when the rm command failed (when running through script editor). Z > o 0rmstatusrmStatus m0 I  .sysodlogaskrTEXT b  o 0imgpathimgPath m* could not be deleted l l E?move curImg to trash -- results in AppleEvent handler failed :(~move curImg to trash -- results in AppleEvent handler failed :( l    l     r# b o 0newlinenewLine o 0imgpathimgPath o 0newlinenewLine r$- b$+ b$) o$% 0theouttheOut o%( 0newlinenewLine o)*  ret o 0theouttheOut l.. I.5 .ascrcmnt******** m.1### ------------------------------------------------------------------------ ### I6= .ascrcmnt******** o69 0curnamecurName l>>  log diskName log diskName I>E .ascrcmnt******** o>A 0imgpathimgPath lFF lFF 0curimgcurImg o 0theseltheSel lMM lMM 71 Delete the copied library file (if we copied it)b Delete the copied library file (if we copied it) ZMp =MR oMP 0 libcopied libCopied mPQ  boovtrue kUl rUd bU` mUXrm lX_ nX_ 1[_  strq oX[ 0 libdbposix libDBPOSIX o 0 thescript theScript Iel .sysoexecTEXTTEXT oeh 0 thescript theScript lqq lqq _Y Delete all empty folders -- Enable this if you want by uncommenting the two lines below Delete all empty folders -- Enable this if you want by uncommenting the two lines below   lqq    `Zset theScript to "find /Volumes/" & diskName & " -depth -empty -type d -exec rmdir {} \\;"   set theScript to "find /Volumes/" & diskName & " -depth -empty -type d -exec rmdir {} \\;"  lqq do shell script theScript2do shell script theScript lqq lqq  empty trash empty trash  $m fstpalisT Macintosh HDœXH+ Aperture.app; \~Z ApplicationsœX~Z&Macintosh HD:Applications:Aperture.app Aperture.app Macintosh HDApplications/Aperture.app/" lxx rx bx} !  oxy 0 filesdeleted filesDeleted !my|""## files have been deleted. You should now delete these from your Aperture library. o 0 returnmsg returnMsg$% $I&' .sysodlogaskrTEXT &c() (o 0 returnmsg returnMsg )m  TEXT'*  btns *J++, ,m--..OK%/0 /l012 1l34 3display dialog theOut455*display dialog theOut26 6L7 7o 0theouttheOut89 8l9:; :l<= <| ---------------------------------------------------------------------------------------------------------------------------=>> ---------------------------------------------------------------------------------------------------------------------------;?@ ?i AB AI 0 getlibpath getLibPath BknCCDE DlFG F set p_defaults to "/usr/bin/defaults" set p_opts to "read com.apple.aperture LibraryPath" set p_script to p_defaults & space & p_opts set p_libPath to do shell script p_script GHHp set p_defaults to "/usr/bin/defaults" set p_opts to "read com.apple.aperture LibraryPath" set p_script to p_defaults & space & p_opts set p_libPath to do shell script p_script EIJ IlJKL KOMN MrOP OnQR Q1  valL RnST S4U  plii UmVVWWLibraryPath T4X  plif XlY YbZ[ Zl \ \I ]^ .earsffdralis afdr ]m  afdrpref^_  rtyp _m  utxt [m ``aa0com.apple.Aperture.plist Po 0 p_libpath p_libPath Nmbbsevsalis Macintosh HDœXH+uSystem Events.appwfG CoreServicesœXf7 u10:Macintosh HD:System:Library:CoreServices:System Events.app$System Events.app Macintosh HD-System/Library/CoreServices/System Events.app/Lcd cldef eZlghi gl$j j>$kl kl"m mI"n .sysooffslongnullnop  psof omqqrr~ps  psin so 0 p_libpath p_libPath lm"# hk'bttuv ul''wx w*$ set p_posix to POSIX file p_libPathxyyH set p_posix to POSIX file p_libPathvz{ zl''{|} |r'*~ ~m'(/bin/echo $HOME o 0p_script} r+2 l+0 I+0 .sysoexecTEXTTEXT o+, 0p_script o 0 p_homepath p_homePath l33 r3@ I3> .sysooffslongnull  psof m58~  psin o9: 0 p_libpath p_libPath o 0p_offset rAR nAP 7BP  ctxt lHL [HL oIJ 0p_offset mJK mMO oAB~ ~0 p_libpath p_libPath o} } 0p_path lSS|{z|{z rSZ bSV oSTy y0 p_homepath p_homePath oTUx x 0p_path ow w0 g_libpath g_libPathv I[but u.ascrcmnt******** o[^s s0 g_libpath g_libPathtv ikel rej oefr r0 p_libpath p_libPath oq q0 g_libpath g_libPathp lkkonmonmpfl lmmkjikjil@h lgfegfehddcba c 0p_sql b.aevtoappnull**** a0 getlibpath getLibPath`_^] `.aevtoappnull****_^\ \0curimgcurImgK[ZYXWV:U>TSKNRQTPONML^KJIHGFEDCBA@?>=<;:987356RT5jl432"1- [0 getlibpath getLibPath Z ret Y0theouttheOut X sele W0theseltheSel V0 filesdeleted filesDeleted U.corecnte******** T0 dialogmsg dialogMsg S btns R dflt Q appr P dispO N.sysodlogaskrTEXT M rslt L bhit K0 libcopied libCopied J0 g_libpath g_libPath I psxp H0libposixlibPOSIX G TEXT F 0libdbposixoriglibDBPOSIXOrig E0 libdbposix libDBPOSIX D.ascrcmnt******** C kocl B cobj A rkrd @0isrefisRef ? ID >0curidcurID = pnam <0curnamecurName ;0newlinenewLine : strq 90 thescript theScript 8.sysoexecTEXTTEXT 70 zfileuuid ZFILEUUID 60 zimagepath ZIMAGEPATH 5"0zfilevolumeuuidZFILEVOLUMEUUID 40disknamediskName 30imgpathimgPath 20rmstatusrmStatus 10 returnmsg returnMsg])j+OEOj*,EQOjEOj %%EOlvlaaka O_a,a-fE`O_a,E`O_a%a&E`O_a%a&E`O_j Ojv )ja!YhO[a"a#l kha$,E`%Oa&,E`'Oa(,E`)Oa*_)%a+%E`,O_%e8_f.a-_a.,%a/%_a.,%E`0O_0j 1OeE`YhOb_a.,%a2%_'%a3%E`0O_0j 1E`4Ob_a.,%a5%_4%a6%E`0O_0j 1E`7Ob_a.,%a8%_4%a9%E`0O_0j 1E`:Ob_a.,%a;%_:%a<%E`0O_0j 1E`=Oa>_=%a?%_7%E`@OaA_@a.,%aB%E`0O_0j 1E`COkEO_CaD_@aE%j YhOPYhO_,_@%E`,O_,%%EOaFj O_)j O_@j OP[OY]O_eaG_a.,%E`0O_0j 1YhOPYhUOaH%E`IO_Ia&aJkvl O0B/.- 00 getlibpath getLibPath/.,+*)( ,0 p_libpath p_libPath + 0p_script *0 p_homepath p_homePath ) 0p_offset ( 0p_pathb'&%$#`"V! q ' plif & afdrpref % rtyp $ utxt #.earsffdralis afdr " plii ! valL  psof  psin .sysooffslongnull .sysoexecTEXTTEXT  ctxt 0 g_libpath g_libPath .ascrcmnt********-o*l %//,EUO* j@EOj EO*a EO[a\[Zk\Zi2EO%E`O_j Y E`OPOPascr ޭ