FasdUAS 1.101.10 k l # Export Contacts to Yahoo CSV (http://aurelio.net/bin/as) by Aurelio Marinho Jargas v1.2 - April 18, 2005 Apple Script to export the Address Book contacts to the Yahoo! CSV format. Then they can be uploaded to the Yahoo Web-based Address Book. Features: Exports all contacts or a selected group Exports ALL fields that are used by Yahoo Address Book, including groups. Correctly handles quote character escaping, international text and date formats. The four Yahoo custom fields are filled with IM numbers: ICQ, MSN, AIM and Jabber Usage: Just run this script and it will save the "Yahoo-AB.csv" file to your Desktop. Install: Save this script file under the "Library/Scripts/Address Book Scripts" folder, inside your personal folder ($HOME). Create this folder if necessary. History: v1.0 March 9, 2005 First public release v1.1 March 12, 2005 MaxContacts set to 999, MaxContacts sanity check, AvailableFilePath() v1.2 April 18, 2005 Group selection, Informative headers, Open in Finder/TextEdit, It-will-take-time message v1.2a October 23, 2005 Modified by Hank Dolben http://www.dolben.org Mapped Mac Groups to Yahoo Distribution Lists, since these are meant for the same thing: mailing lists. Yahoo categories aren't modeled in the Mac Address Book. Also, used the first Mac email address, when there is no home address, for primary Email in Yahoo. Then the next two that aren't the primary are the alternatives. v1.2b October 29, 2005 Added Yahoo fields following "Comments" and re-mapped IM IDs. Added Anniversary. Mapped boolean company to Yahoo category of "company" or "person" Thanks: Rona Wronkeri (USA) for requesting the Group Selection. Damien Andrews (Australia) for typos fixes, informative headers suggestion. Details: Note that Yahoo! has some storage limitations: 3 e-mail addresses 2 street addresses (home, work) 1 fax number Yahoo! import road map: Log in your Yahoo! Mail account Click "Addresses" tab (upper left) Click "Import/Export" link (upper right) Step 1) Choose "Yahoo! (.CSV file)" Step 3) Choose the file generated by this script Step 4) Click "Import Now" button Done! Yahoo! successful importing tips: If possible, first remove all your previous contacts. The nickname cannot contain spaces or symbols, use just letters. The e-mails are checked, make sure they are valid. Duplicated nicknames are not allowed. Most fields are OK to be empty. Most fields are equivalent in both Address Books, but some haven't got a direct pair. The following is the complete list of corresponding fields used by this script: Apple Address Book Yahoo! Address Book ----------------------------------------------------------- First Name First Middle Name Middle Last Name Last Nickname Nickname Company Category Group Distribution Lists Home e-mail Email Work e-mail Alternative Email 1 Other e-mail Alternative Email 2 Home Phone Home Work Phone Work Mobile Phone Mobile Other Phone Other Pager Phone Pager Work Fax Fax Home Fax - - Yahoo! Mailbox - Primary Home Page Personal Web Site - Company Web Site Job Title Title Department - Company Company Work Street Work Address Work City Work City Work Province Work State Work ZIP Work ZIP Work Country Work Country Home Street Home Street Home City Home City Home Province Home State Home ZIP Home ZIP Home Country Home Country Birthday Birthday Anniversary Anniversary Note Comments IM Yahoo Messenger ID IM ICQ ICQ ID IM MSN MSN ID IM AIM AIM ID IM Jabber Messenger ID1 Note: It is my real first Apple Script. Improvements are VERY welcome.  l  l  l =7 ##################################### USER CONFIG HERE  l l HB The resulting CSV file location (default is Desktop:Yahoo-AB.csv) l  r  l  b  l c l I .earsffdralis afdr m  afdmdesk m  ctxt m! ! Yahoo-AB.csv o 0csvfileCsvFile"# "l#$% $l& &>8 Default values for fields not available in Address Book%'( 'l ) )r *+ *m , , Unfiled +o .0yahoodistributionlistYahooDistributionList(-. -l/ /r01 0m2 2 home 1o 0yahoomainphoneYahooMainPhone.34 3l456 5l7 7+% Maximum number of contacts to export689 8l: :r;< ;m <o 0 maxcontacts MaxContacts9=> =l>?@ ?lA A)# List with all the Yahoo CSV fields@BC BlD Dsm If your language is not listed here, get the field names in the first line of your Yahoo generated CSV file.CEF ElFGH GlI I# English fields. The default.HJK JlL LrMN MJOOPQ PmR R FirstQST SmU U MiddleTVW VmX X LastWYZ Ym[ [NicknameZ\] \m^ ^ Email]_` _m a aCategory`bc bm #d dDistribution Listscef em#&g g Messenger IDfhi hm&)j j Homeikl km),m m Worklno nm,/p p Pageroqr qm/2s s Faxrtu tm25v v Mobileuwx wm58y y Otherxz{ zm8;| | Yahoo! Phone{}~ }m;>  Primary~ m>A Alternate Email 1 mAD Alternate Email 2 mDG Personal Website mGJ Business Website mJM Title mMP Company mPS  Work Address mSV  Work City mVY  Work State mY\ Work ZIP m\_  Work Country m_b  Home Address mbe  Home City meh  Home State mhk Home ZIP mkn  Home Country mnq Birthday mqt  Anniversary mtw Custom 1 mwz Custom 2 mz} Custom 3 m} Custom 4 m Comments m  Messenger ID1 m  Messenger ID2 m  Messenger ID3 m  Messenger ID4 m  Messenger ID5 m  Messenger ID6 m  Messenger ID7 m  Messenger ID8 m  Messenger ID9 m Skype ID m IRC ID m ICQ ID m  Google ID m MSN ID m AIM ID m QQ ID No 0 yahoofields YahooFieldsK l l NH Portuguese fields. Uncomment this if your account is from Yahoo! Brasil l *$set YahooDistributionList to "Todos" l 5/set YahooFields to {"Nome", " ", "Sobrenome", "Apelido", "E-mail", "Categoria", "Listas de distribuio", "ID Yahoo!", "Informaes pessoais", "Trabalho", "Pager", "Fax", "Celular", "Outro", "Fone Yahoo!", "Principal", "E-mail alternativo 1", "E-mail alternativo 2", "Web site pessoal", "Website da empresa", "Cargo", "Empresa", "Endereo", "Cidade", "Estado", "CEP", "Pas", "Endereo residencial", "Cidade", "Estado", "CEP", "Pas", "Data de nascimento", "Aniversrio", "Complemento 1", "Complemento 2", "Complemento 3", "Complemento 4", "Comentrios"} l l ?9 ##################################### END OF USER CONFIG l l r   m  "Export Contacts to Yahoo CSV  o 0 scriptname ScriptName   l r m  1.2b o 0 scriptversion ScriptVersion  l r m  Yahoo-AB.csv o (0defaultcsvfilenameDefaultCsvFileName l r m o 0 contactcount ContactCount l r !  J !o 0alllinesAllLines"# "l#$% $l& &E? Join list items in a single string, quoted and comma separated%'( 'l) )# Example: "one","two","three"(*+ *i,- ,I. 0 listtocsvline ListToCsvLine./ /o 0thelisttheList -k0012 1r34 3m5 5 "," 4n67 61  txdl 71  ascr289 8r:; :b<= <b >? >l @ @c AB Ab CD CmE E" Do 0thelisttheList Bm  ctxt ?m F F" =o   ret ;o 0csvlineCsvLine9GH GrIJ ImK K JnLM L1  txdl M1  ascrHN NLO Oo 0csvlineCsvLine+PQ PlQRS RlT T>8 Convert from date property to Yahoo "MM/DD/YYYY" formatSUV UiWX WIY 0 formatdate FormatDateYZ Zo 0thedatetheDate Xk5[[\] \Z ^_ ^=`a `o 0thedatetheDate am  msng _Lb bmc c]de dr fg fc hi hn jk j1  day ko  0thedatetheDate im  ctxt go 0delm lrno ncpq pnrs r1  year so 0thedatetheDate qm  ctxt oo 0ymtu tr$vw vc"xy xn z{ zm  mnth {o 0thedatetheDate ym !  long wo 0mu|} |l%*~ ~r%* c%( o%& 0m m&'  ctxt o 0m  no need to zeropad} L+5 b+4 b+2 b+0 b+. o+, 0m m,- / o./ 0d m01 / o23 0yV l l A; Normalize (format & escape) the value of a Contact's field i  I 0fixitFixIt o 0thevaluetheValue kV l l LF XXX: dirty hack, don't know how to check if a variable is not defined Q r o 0thevaluetheValue o 0fooFOO R .ascrerr ******** r m  o 0thevaluetheValue l~}~} l||  Map missing to empty Z{z = oy y0thevaluetheValue mx x msng l w r m  ov v0thevaluetheValuew{z l utut l ss )# From here, we only know about text Z 1rq > % n # 1!#p p pcls o !o o0thevaluetheValue m#$n n ctxt l (-m r(- c(+ o()l l0thevaluetheValue m)*k k ctxt oj j0thevaluetheValuemrq l22ihih l22gg ;5 Every embedded quote is doubled ("->"") on Yahoo CSV Z2Sfe E25 o23d d0thevaluetheValue m34 " k8O r8= m89 " n 1:C n>A 2?Aa a citm o>?` `0thevaluetheValue o_ _ 0tmp_list rDI mDE "" n 1FH^ ^ txdl 1EF] ] ascr\ rJO cJM oJK[ [ 0tmp_list mKLZ Z TEXT oY Y0thevaluetheValue\fe lTTXWXWV LTV oTUU U0thevaluetheValueV lTSTS lRR C= Gives an alternate file name if the given one already exists i  IQP Q&0availablefilepathAvailableFilePath oO O0filepathFilePathN oM M"0defaultfilenameDefaultFileNameNP k Z LK = oJ J"0defaultfilenameDefaultFileName  m   r    m  a  oI I"0defaultfilenameDefaultFileNameLK lHGHG OZ kY lFF C= If user defined a folder, set the default filename inside it Z+ED ICB C.coredoexboolobj 4A A cfol o@ @0filepathFilePathB l '? r' b%!" !l##> #c#$% $4!=& = cfol &o < <0filepathFilePath %m!"; ; ctxt> "o#$: :"0defaultfilenameDefaultFileName  o9 90filepathFilePath?ED'( 'l,,8787()6 )Z,Y*+5, *H,5- -l,4.4 .I,43/2 3.coredoexboolobj /4,010 1 file 0o./0 00filepathFilePath24 +k8:1123 2l88/4/ 4;5 File not found, the name is vacant and we're done 35. 5L8:6 6o89- -0filepathFilePath.5 ,k=Y7789 8l==,:, : Name unavailable :(9;< ;r=G=> =c=E?@ ?n=CAB AmAC+ + ctnr B4=A*C * file Co?@) )0filepathFilePath @mCD( ( ctxt >o' '0dirnameDirName<DE DrHPFG FnHNHI H1LN& & pnam I4HL%J % file JoJK$ $0filepathFilePath Go# #0basenameBaseNameEK" KrQYLM LnQWNO N1UW! ! nmxt O4QU P  file PoST 0filepathFilePath Mo 0extnameExtName"6 mQQnull߀"` Finder.app0rLrbȿ`K`()8(K ߀UMACSalisTHDFwH+"` Finder.app#"ɻK CoreServicesF "`"X"W)HD:System:Library:CoreServices:Finder.app Finder.appHD&System/Library/CoreServices/Finder.app/RS Rl[[STU Tl[[V V% Get basename without extensionUWX WZ[YZ Y>[^[\ [o[\ 0extnameExtName \m\]] ] Zka~^^_` _rafab amabc c. bnde d1ce  txdl e1bc  ascr`fg frgvhi hcgtjk jngrlm l7hrno  citm nmln omoq mogh 0basenameBaseName kmrs  ctxt io 0basenameBaseNamegp prw~qr qmwzs s rntu t1{}  txdl u1z{  ascrXvw vl   wxy xl z z-' Add the count at the end (-1, -2, ...)y{| {Y} ~ }k l ?9 Compose the new name (with count and extension - if any) r c b b o 0basenameBaseName m - o 0i m  ctxt o 0 newbasename NewBaseName Z > o 0extnameExtName m  l  r b b o 0 newbasename NewBaseName m . o 0extnameExtName o 0 newbasename NewBaseName l -' If it's free, we've found the new name O l  Z H l G l I .coredoexboolobj 4  file o 0 newbasename NewBaseName l I .coredoexboolobj 4  cfol o 0 newbasename NewBaseName S mQ 0i ~m mc| l L b o 0dirnameDirName o 0 newbasename NewBaseName l l % Write the CSV file on the disk i I 0 writefile WriteFile o 0filedataFileData o 0filepathFilePath QI k* r c o 0filepathFilePath m  ctxt o 0filepathFilePath r  I  .rdwropenshorfile 4   file o 0filepathFilePath  perm m  boovtrue o 0fd I! .rdwrwritnull**** o 0filedataFileData  as m  utxt  refn l o 0fd  wrat m I"' .rdwrclosnull**** l"# o"# 0fd L(* m()  boovtrue R .ascrerr ******** k2I Q2F I5= .rdwrclosnull**** 459  file o78 0filepathFilePath R .ascrerr ******** LGI mGH  boovfals l l WQ Extract all information of a Contact, in the right CSV order, and save to a list i I (0contacttoyahoolistContactToYahooList o 0 thecontact theContact o 0thegrouptheGroup kF r J o 0buf O= O < k ; l     l     Add the full name & nick    r  n  I 0fixitFixIt 1  azf7 f  n ; o 0buf r$ n! I! 0fixitFixIt 1  az40 f n ;"#  o!" 0buf!" !r%0#$ #n%-%& %I&-' 0fixitFixIt'( (1&)  azf8 &f%& $n)* );./ *o-. 0buf"+, +r1<-. -n19/0 /I291 0fixitFixIt12 2125  az43 0f12 .n34 3;:; 4o9: 0buf,56 5l==678 7l==9 9 Home or first e-mail8:; :l==< <C= (except for company, because Yahoo! shows this as item link);=> =r=@?@ ?m=>A A @o &0firstemailaddressfirstEmailAddress>BC BZADE DFAPFG FHAEH H1AD  az51 G>HNIJ I2HK  az21 JJKM EkS{KKLM LrSdNO N6SbPQ PnSYRS R1WY  az17 S4SWT  az21 TmUV Q=ZaUV U1[]  az18 Vm^`W W home Oo 0addrMX XQe{YZ[ Yrhk\] \ohi 0addr ]o &0firstemailaddressfirstEmailAddress ZR .ascrerr ******** [rs{^_ ^nsy`a `1wy  az17 a4sw~b ~ az21 bmuv}} _o| |&0firstemailaddressfirstEmailAddressCcd cref engh gI{iz {0fixitFixItijy jox x&0firstemailaddressfirstEmailAddressyz hf fnkl k; low w0bufdmn mlvuvunop oltqt q Categoryprs rZtusv t1r r az51 urwx wmy y company xnz{ z; {oq q0bufs vr|} |m~ ~ person }n ; op p0bufs lonon lmm  Distribution lists r m  ol l&0distributionlistsdistributionLists Xk k Zji > oh h&0distributionlistsdistributionLists m  r b og g&0distributionlistsdistributionLists m , of f&0distributionlistsdistributionListsjie r b od d&0distributionlistsdistributionLists n 1c c pnam ob b0agroupaGroup oa a&0distributionlistsdistributionListse k0agroupaGroup l` n m_ _ azf5 o^ ^0 thecontact theContact` r n I]\ ]0fixitFixIt[ oZ Z&0distributionlistsdistributionLists[\ f n ; oY Y0buf lXWXW lVV  IM: Yahoo Q  r n IUT U0fixitFixItS n 1R R az17 4Q Q az25 mPPST f n ; oO O0buf RNML N.ascrerr ********ML r  m   n ;  o  K K0buf lJIJI lHH  Phone numbers ZG ? lF IED E.corecnte******** 2C C az20DF mBB k r7 n4 I4A@ A0fixitFixIt? 60 n% 1#%> > az17 4#= = az20 m!"<< =&/ 1'); ; az18 m*.  home?@ f n ;56 o45: :0buf r8S n8P I9P98 90fixitFixIt7 69L n9A 1?A6 6 az17 49?5 5 az20 m=>44 =BK 1CE3 3 az18 mFJ  work78 f89 n ;QR oPQ2 20buf rTo nTl IUl10 10fixitFixIt/ 6Uh nU] 1[]. . az17 4U[- - az20  mYZ,, =^g   1_a+ + az18  mbf  pager/0 fTU n   ;mn olm* *0buf rp np Iq)( )0fixitFixIt' 6q nqy 1wy& & az17 4qw% % az20 muv$$ =z 1{}# # az18 m~ work fax'( fpq n ;  o" "0buf!" !r#$ #n%& %I!' !0fixitFixIt'( (6)* )n+, +1  az17 ,4-  az20 -m *=./ .1  az18 /m0 0 mobile &f $n12 1; 2o 0buf"3 3r45 4n67 6I8 0fixitFixIt89 96:; :n<= <1  az17 =4>  az20 >m ;=?@ ?1  az18 @mA A other 7f 5nBC B; Co 0bufG lDE DrFG FbHI Ho 0buf IJJJKL KmM MLNO NmP POQR QmS SRTU TmV VUWX WmY YXZ Zm[ [ Go 0buf E 6 empty\] \l   ]^_ ^l ` `2, Yahoo phone and Main phone (not used in AB)_ab arcd cme e dnfg f; go 0bufbhi hrjk jnlm lI n 0fixitFixItno onpq po  0yahoomainphoneYahooMainPhone qf mf knrs r; so 0bufitu tluvw vlx x Alternative e-mailswyz yr{| {m |o ,0alternativeaddressesalternativeAddressesz}~ }X@ k; r n 1  az17 o 0anemailanEmail o 0 nextaddress nextAddress Z; > o 0 nextaddress nextAddress o &0firstemailaddressfirstEmailAddress k7 r! [ o ,0alternativeaddressesalternativeAddresses m o ,0alternativeaddressesalternativeAddresses r"+ n"( I#( 0fixitFixIt o#$ 0 nextaddress nextAddress f"# n ;)* o() 0buf Z,7 ?,/ o,- ,0alternativeaddressesalternativeAddresses m-. S23 0anemailanEmail 2  az21~ VAZ kIU rIN [IL oIJ ,0alternativeaddressesalternativeAddresses mJK o ,0alternativeaddressesalternativeAddresses rOU mOR  n ;ST oRS 0buf AEH oEF ,0alternativeaddressesalternativeAddresses mFG l[[ l[[  Personal homepage l[[ % Work homepage (not used in AB) Z[ 1[_  az51 kbv rbh mbe  n ;fg oef 0buf riv nis Ijs 0fixitFixIt 1jo  az13 fij n ;tu ost 0buf ky ry ny Iz 0fixitFixIt 1z  az13 fyz n ; o 0buf r m  n ; o 0buf l l  Job info r n I 0fixitFixIt 1  az12 f n ; o 0buf r n I 0fixitFixIt 1  az38 f n ; o 0buf l l B< Work and Home addresses (street, city, state, zip, country) Z  ? l  I .corecnte********  2  az27  m k     r n I 0fixitFixIt 6 n 1  az28 4  az27 m = 1  az18 m  work f n ; o 0buf r!" !n#$ #I% 0fixitFixIt%& &6'( 'n)* )1  az29 *4+  az27 +m (=,- ,1  az18 -m. . work $f "n/0 /; 0o 0buf 12 1r34 3n56 5I7 0fixitFixIt78 86 9: 9n;< ;1  az30 <4=  az27 =m := >? >1  az18 ?m@ @ work 6f 4nAB A; Bo 0buf2CD Cr/EF En,GH GI,I 0fixitFixItIJ J6(KL KnMN M1  az31 N4O  az27 Om L='PQ P1!  az18 Qm"&R R work Hf FnST S;-. To,- 0bufDUV Ur0MWX Wn0JYZ YI1J[ 0fixitFixIt[\ \61F]^ ]n1;_` _17;  az32 `417a  az27 am56 ^=<Ebc b1=?  az18 cm@Dd d work Zf01 Xnef e;KL foJK 0bufVgh glNNhij irNkkl knNhmn mIOho 0fixitFixItop p6Odqr qnOYst s1UY  az28 t4OUu  az27 umST r=Zcvw v1[]  az18 wm^bx x home nfNO lnyz y;ij zohi 0bufj{| {rl}~ }nl Im 0fixitFixIt 6m nmw 1sw  az29 4ms  az27 mqr =x 1y{  az18 m|  home flm ~n ; o~ ~0buf| r n I}| }0fixitFixIt{ 6 n 1z z az30 4y y az27 mxx = 1w w az18 m  home{| f n ; ov v0buf r n Iut u0fixitFixIts 6 n 1r r az31 4q q az27 mpp = 1o o az18 m  homest f n ; on n0bufm r n Ilk l0fixitFixItj 6 n 1i i az32 4h h az27 mgg = 1f f az18 m  homejk f n ; oe e0bufm l  r  b  od d0buf J  m  m  m  m  m  m  m  m  m c m c ob b0buf  10 empty l  a`a` l  __  Birth date r  n  I^] ^0fixitFixIt\ n I[Z [0 formatdate FormatDateY 1X X az11YZ f\] f  n ; oW W0buf l  VUVU l  TT  Anniversary Q Q r#C n#@ I$@SR S0fixitFixItQ n$<   I%=>=456 5lgg<7< 7  Notes689 8rgt:; :ngq<= <Ihq;>: ;0fixitFixIt>?9 ?1hm8 8 az379: =fgh ;n@A @;rs Aoqr7 70buf9BC Bluu6565CDE Dluu4F4 F IM: JabberEGH GQuIJK IrxLM LnxNO NIy3P2 30fixitFixItPQ1 QnyRS R10 0 az17 S4y/T / az23 Tm}~..12 Ofxy MnUV U; Vo- -0buf JR,+* ,.ascrerr ********+* KrWX WmY Y XnZ[ Z; [o) )0bufH\] \l('(']^_ ^l&`& ` Messenger ID2 - 9_ab arcd cbef eo% %0buf fJgghi hmj jikl kmm mlno nmp poqr qms srtu tmv vuwx wmy yxz{ zm| |{}$ }m~ ~$ do# #0bufb l"!"! l   Skype ID r m  n ; o 0buf l l   IRC ID r m  n ; o 0buf l l  IM: ICQ Q r n I 0fixitFixIt n 1  az17 4  az26 m f n ; o 0buf R .ascrerr ******** r m  n ; o 0buf l    l   Google ID r m  n ; o 0buf l l  IM: MSN Q r n I 0fixitFixIt n 1  az17 4  az24 m f n ; o 0buf R .ascrerr ******** r  m    n ; o  0buf l l  IM: AIM Q2 r$ n! I! 0fixitFixIt n 1  az17 4  az22 m f n ;"# o!" 0buf R .ascrerr ******** r,2 m,/  n ;01 o/0 0buf l33 l33   QQ ID r39 m36  n ;78 o67 0buf l:: o 0 thecontact theContact mnullrAddress Book.appLȔrbȿ` K`()8(K ߀UadrbalisFHDFwH+Address Book.app#㻚Հ ApplicationsF  HD:Applications:Address Book.app"Address Book.appHDApplications/Address Book.app/ I>C .ascrcmnt******** l>? o>? 0buf LDF oDE 0buf l l   D> ###################################### Processing begins here   l    l O k l l % First dialog: quit, all, group ID .sysodlogaskrTEXT l ( l( b( b$ b !" !b#$ #b%& %b'( 'b)* )b +, +b-. -b/0 /b12 1b34 3b56 5b78 7b9: 9o 0 scriptname ScriptName :m; ; version  8l< <c=> =o 0 scriptversion ScriptVersion >m  ctxt 6o  ret 4o  ret 2l ? ?m@ @Hi, I'm a robot.  0l A AmB BZTMy life's purpose is to convert your Address Book contacts to the Yahoo CSV format.  .l C CmD D4.Then you can populate your Yahoo! Web account. ,o  ret *o   ret (l E EmF FC=It will take just a few seconds (with no progress indicator). &o  ret $o  ret "l G GmH HE?Do you want to convert all contacts or choose a specific group?  o #  ret o$'  ret IJ  btns Il +6K KJ+6LLMN Mm+.O O CancelNPQ Pm.1R R All ContactsQS Sm14T T Choose GroupJUV  dflt Um9:VW  disp Wm=>XY XrEPZ[ ZnEL\] \1HL  bhit ]lEH^ ^1EH  rslt [o $0useractionchoiceUserActionChoiceY_` _lQQ`ab alQQc c0* Get information about the Book as a wholebde drQ^fg fnQZhi h1VZ  pnam i2QV  azf5 go 0 allgroups allGroupsejk jr_jlm lI_fn .corecnte******** nm_b  azf4 mo 0 totalcontacts TotalContactskop olkkpqr qlkks s,& The user will choose a specific grouprtu tZkvwx v=kryz yokn $0useractionchoiceUserActionChoice zmnq{ { Choose Group wku||}~ }ru Iu .gtqpchltTEXT@@TEXT oux 0 allgroups allGroups  prmp l {~ m{~ 3-Choose one Address Book group to be exported:  okbt m  Export o 0 usergroup UserGroup~ l Z = o 0 usergroup UserGroup m  boovfals L ! User pressed Cancel button l -' Get information about the chosen group r I .corecnte******** n m  azf4 5  azf5 o 0 usergroup UserGroup  kfrmname o 0 totalcontacts TotalContacts xr m  o 0 usergroup UserGroupu l l =7 It-will-take-time warning for large amount of contacts Z ? o 0 totalcontacts TotalContacts md I .sysodlogaskrTEXT l  l b b b b b b o 0 scriptname ScriptName o  ret o  ret l  m ,&Wow! More than 100 contacts to export. o  ret o  ret l  m /)Please be patient, this may take a while.  btns J~ m OK~} } dflt m||{ { disp mzzyx y givu mwwx lvuvu ltt  Sanity check ZXsr A  oq q0 maxcontacts MaxContacts o p p0 totalcontacts TotalContacts ITo o.sysodlogaskrTEXT l ;n l;m b; b7 b3 b/ b+ b) b% b! b b b ol l0 scriptname ScriptName ok k ret oj j ret l i m Warning: You have i o h h0 totalcontacts TotalContacts m!$  contacts to export,  l %(g m%( ("but the current maximum is set to g o)*f f0 maxcontacts MaxContacts m+. . o/2e e ret o36d d ret l 7:c m7: TNTo export all contacts, set the "MaxContacts" configuration to a higher value.cmnb b btns J>F m>A  Cancela mAD Continuea` ` dflt mIJ__^] ^ disp mMN\\]sr lYY[Z[Z lYYYY 0* Add the field names to the first CSV line sYf nYa IZaX W X0 listtocsvline ListToCsvLine  V  oZ]U U0 yahoofields YahooFieldsVW  fYZ l T  n   ;de oadS S0alllinesAllLinesT lggRQRQ lggPP & Query only the desired contacts ZgO =gn ogjN N0 usergroup UserGroup mjm  rq{ Nqw 2qvM M azf4 oL L0 allcontacts AllContactsO r~ N~! !n~"# "2K K azf4 #5~J$I J azf5 $oH H0 usergroup UserGroup I kfrmname  oG G0 allcontacts AllContacts%& %lFEFE&'( 'lD)D )XR Here we go, extracting info of every contact and saving it to the AllLines buffer(*+ *X,C- ,k../0 /Z12BA 1=34 3o@ @0 contactcount ContactCount 4o? ?0 maxcontacts MaxContacts 2SBA056 5r78 7[9: 9o> >0 contactcount ContactCount :m== 8o< <0 contactcount ContactCount6;< ;l;:;:<=> =r?@ ?nAB AI9C8 9(0contacttoyahoolistContactToYahooListCDE Do7 70contactContactEF6 Fo5 50 usergroup UserGroup68 Bf @o4 40 contactinfo ContactInfo>G3 GsHI HnJK JI2L1 20 listtocsvline ListToCsvLineLM0 Mo/ /0 contactinfo ContactInfo01 Kf IlN. NnOP O; Po- -0alllinesAllLines.3 C0contactContact -o, ,0 allcontacts AllContacts+Q+ Ql*)*)+ m RS Rl('('STU Tl&V& V/) Make sure we will not overwrite any fileUWX WlY% YrZ[ ZI$\# $&0availablefilepathAvailableFilePath\]^ ]o" "0csvfileCsvFile^_! _o (0defaultcsvfilenameDefaultCsvFileName!# [o 0csvfileCsvFile%X`a `labc bld d(" Write the CSV file to the Desktopcef elg grhi hIj 0 writefile WriteFilejkl kcmn mo 0alllinesAllLines nm  ctxtlo oo 0csvfileCsvFile io 0saveokSaveOkfpq plqrs rlt t O-oh, file not saved :(suv ul>w wZ>xy xHz zo 0saveokSaveOk yk:{{|} |I7 ~ .sysodlogaskrTEXT ~l+ b+ b' b# b b b b b o 0 scriptname ScriptName o   ret o  ret l  m B  ohk 0tmpfileTmpFile lq Iq .sysoexecTEXTTEXT bq bq| bqx mqt  mv  otw 0tmpfileTmpFile mx{   o| 0 csvunixfile CsvUnixFile l l )# Great! CSV file successfully saved l I .sysodlogaskrTEXT b b l b b b b b b b b b o 0 scriptname ScriptName o  ret o  ret l  l c o 0 contactcount ContactCount m  ctxt l  m KE contacts were exported from your Address Book to the following file: l  o  ret  o  ret 1  tab 1  tab l c o 0csvfileCsvFile m  ctxt o  ret l  o  ret   btns l  J     m  Show in Finder    m  Open in TextEdit   m  Just Quit  dflt m   disp m  l  r   n   1  bhit 1  rslt o 0 lastaction LastAction    l    l  .( Open the CSV file in Finder or TextEdit    l  % Errors are cowardly ignored :)    l:  Q:  Z1 ! " # != $ % $o 0 lastaction LastAction %m & &Show in Finder "O ' ( 'k ) ) * + *I .miscactvnullnull + , ,I - .miscmvisnullobj -4 .  file .o 0csvfileCsvFile (mQ # / 0 /= 1 2 1o 0 lastaction LastAction 2m  3 3Open in TextEdit 0 4 4O- 5 6 5k, 7 7 8 9 8I .ascrnoop******** 9 : ; :I! .miscactvnullnull ; < <I", = .aevtodocnullalis =4"( >  file >o&' 0csvfileCsvFile 6m ? ?nulla߭ TextEdit.app rLrbȿPHK`4)8(K pUttxtalis6HDFwH+ TextEdit.app#K㻚_ ApplicationsFHD:Applications:TextEdit.app TextEdit.appHDApplications/TextEdit.app/ R .ascrerr ********  @ @l A B C D E F G H I,2 J  K L M N O P Q R S A~}|{zyxwv 0 listtocsvline ListToCsvLine 0 formatdate FormatDate 0fixitFixIt &0availablefilepathAvailableFilePath 0 writefile WriteFile (0contacttoyahoolistContactToYahooList .aevtoappnull**** 0csvfileCsvFile .0yahoodistributionlistYahooDistributionList 0yahoomainphoneYahooMainPhone 0 maxcontacts MaxContacts 0 yahoofields YahooFields 0 scriptname ScriptName 0 scriptversion ScriptVersion (0defaultcsvfilenameDefaultCsvFileName 0 contactcount ContactCount 0alllinesAllLines $0useractionchoiceUserActionChoice 0 allgroups allGroups ~0 totalcontacts TotalContacts }0 usergroup UserGroup |0 allcontacts AllContacts {0 contactinfo ContactInfo z0saveokSaveOk y0 csvunixfile CsvUnixFile x0tmpfileTmpFile w0 lastaction LastActionv Bu-ts T Ur u0 listtocsvline ListToCsvLinetq Vq Vp p0thelisttheLists Ton o0thelisttheList n0csvlineCsvLine U5mlEkFjK m ascr l txdl k ctxt j ret r,FO%&%%EO,FO CiXhg W Xf i0 formatdate FormatDatehe Ye Yd d0thedatetheDateg Wcba` c0thedatetheDate b0d a0y `0m X _c^]\[Z _ msng ^ day ] ctxt \ year [ mnth Z longf6YhO,&EO,&EO,&EO&EO%%%% DYXW Z [V Y0fixitFixItXU \U \T T0thevaluetheValueW ZSRQ S0thevaluetheValue R 0fooFOO Q 0tmp_list [PONMLKJIHPO N msng M pcls L ctxt K ascr J txdl I citm H TEXTVWEW XEOEYhO, &EYhO,FO-EO,FO&EYhO EGFE ] ^D G&0availablefilepathAvailableFilePathFC _C _BA B0filepathFilePath A"0defaultfilenameDefaultFileNameE ]@?>=<;: @0filepathFilePath ?"0defaultfilenameDefaultFileName >0dirnameDirName =0basenameBaseName <0extnameExtName ;0i :0 newbasename NewBaseName ^  Q9876543]c210/s.- 9 cfol 8.coredoexboolobj 7 ctxt 6 file 5 ctnr 4 pnam 3 nmxt 2 ascr 1 txdl 0 citm/.c - boolDEYhOI*/j */&%EYhO*/j  Y*/,&EO*/,EO*/,EUO",FO[\[Zk\Z2&EOa,FYhOWkakha%%&EOaa%%EYhO"*/j  */j a& YhU[OYO% F,+* ` a) ,0 writefile WriteFile+( b( b'& '0filedataFileData &0filepathFilePath* `%$# %0filedataFileData $0filepathFilePath #0fd a "!  " ctxt ! file  perm .rdwropenshorfile  as  utxt  refn  wrat .rdwrwritnull**** .rdwrclosnull****)J,&EO*/el EOj Oj OeWX  */j WX hOf G c d (0contacttoyahoolistContactToYahooList e e 0 thecontact theContact 0thegrouptheGroup c   0 thecontact theContact 0thegrouptheGroup 0buf &0firstemailaddressfirstEmailAddress 0addr &0distributionlistsdistributionLists 0agroupaGroup ,0alternativeaddressesalternativeAddresses 0anemailanEmail 0 nextaddress nextAddress dnA fWy~ 0AMPSVY[e.@Rdx*-02Yjmpsvy|~  azf7 0fixitFixIt  az40  azf8  az43  az51  az21  bool  az17 f  az18  azf5  kocl  cobj .corecnte********  pnam  az25  az20 0yahoomainphoneYahooMainPhone  az13  az12  az38  az27  az28  az29  az30  az31  az32  az11 0 formatdate FormatDate  az52  az37  az23  az26  az24  az22 .ascrcmnt********GjvEO50)*,k+6FO)*,k+6FO)*,k+6FO)*,k+6FOEO*, *-jv&-*k/,[,\Z81EOEWX*k/,EYhO)k+6FO*,E a6FYa6FOaEO9a,[aal kha a%EYhOa,%E[OYO)k+6FO)*ak/,k+6FW Xa6FO*a-j j)*ak/,[,\Za81k+6FO)*ak/,[,\Za81k+6FO)*ak/,[,\Za81k+6FO)*ak/,[,\Za 81k+6FO)*ak/,[,\Za!81k+6FO)*ak/,[,\Za"81k+6FYa#a$a%a&a'a(a)v%EOa*6FO))a+,k+6FOjEOE*-[aal kh,EO kEO)k+6FOkYhYh[OYOhlkEOa,6F[OYO*,Ea-6FO)*a.,k+6FY)*a.,k+6FOa/6FO)*a0,k+6FO)*a1,k+6FO*a2-j j0)*a2k/a3,[,\Za481k+6FO)*a2k/a5,[,\Za681k+6FO)*a2k/a7,[,\Za881k+6FO)*a2k/a9,[,\Za:81k+6FO)*a2k/a;,[,\Za<81k+6FO)*a2k/a3,[,\Za=81k+6FO)*a2k/a5,[,\Za>81k+6FO)*a2k/a7,[,\Za?81k+6FO)*a2k/a9,[,\Za@81k+6FO)*a2k/a;,[,\ZaA81k+6FY(aBaCaDaEaFaGaHaIaJaKaLv%EO))*aM,k+Nk+6FO%))*aOk/,[,\ZaP81k+Nk+6FW XaQ6FOaRaSaTaUaVv%EO)*aW,k+6FO)*aXk/,k+6FW XaY6FOaZa[a\a]a^a_a`aaabv%EOac6FOad6FO)*aek/,k+6FW Xaf6FOag6FO)*ahk/,k+6FW Xai6FO)*ajk/,k+6FW Xak6FOal6FOPUUOj mO H g h i .aevtoappnull**** gk: j j k k' l l- m m8 n nJ o o p p q q r r s s t t u uW v ve w wu x x y y z z { { | | } } ~ ~  h 0contactContact i!,2RUX[^adgjmpsvy| ;@BDFHORT{   &Q 3 ?  afdmdesk .earsffdralis afdr  ctxt 0csvfileCsvFile .0yahoodistributionlistYahooDistributionList 0yahoomainphoneYahooMainPhone 0 maxcontacts MaxContacts7 0 yahoofields YahooFields 0 scriptname ScriptName 0 scriptversion ScriptVersion (0defaultcsvfilenameDefaultCsvFileName 0 contactcount ContactCount 0alllinesAllLines  ret  btns  dflt  disp .sysodlogaskrTEXT  rslt  bhit $0useractionchoiceUserActionChoice  azf5  pnam 0 allgroups allGroups  azf4 .corecnte******** 0 totalcontacts TotalContacts  prmp  okbt .gtqpchltTEXT@@TEXT 0 usergroup UserGroup  kfrmnamed  givu 0 listtocsvline ListToCsvLine 0 allcontacts AllContacts  kocl  cobj (0contacttoyahoolistContactToYahooList 0 contactinfo ContactInfo &0availablefilepathAvailableFilePath 0 writefile WriteFile 0saveokSaveOk  tab  psxp 0 csvunixfile CsvUnixFile 0tmpfileTmpFile .sysoexecTEXTTEXT 0 lastaction LastAction .miscactvnullnull  file .miscmvisnullobj .ascrnoop******** .aevtodocnullalis;j &%EOEOEOEOaaaaaaaaaaaaaaaaa a!a"a#a$a%a&a'a(a)a*a+a,a-a.a/a0a1a2a3a4a5a6a7a8a9a:a;aa?a@aAaBvE`COaDE`EOaFE`GOaHE`IOjE`JOjvE`KOaL_EaM%_G&%_N%_N%aO%aP%aQ%_N%_N%aR%_N%_N%aS%_N%_N%aTaUaVaWmvaXmaYkaZ [O_\a],E`^O*a_-a`,E`aOabj cE`dO_^aeE_aafagahaiaj kE`lO_lfhYhO*a__lam0ab,j cE`dY anE`lO_dao<_E_N%_N%ap%_N%_N%aq%aTarkvaXkaYlasaZat [YhO_dK_E_N%_N%au%_d%av%aw%%ax%_N%_N%ay%aTaza{lvaXkaYlaZ [YhO)_Ck+|_K6GO_la}*ab-E`~Y*a__lam0ab-E`~OM_~[aal ckh_JYhO_JkE`JO)_ll+E`O)_k+|_K6G[OYOPUO*_Il+EO*_K&l+E`O_ 7_E_N%_N%a%_N%_N%_%_%&%aTakvl [OhYhOa,E`O*_a%al+E`Oa_%a%_%j Oa_%a%_%j O_E_N%_N%_J&%a%_N%_N%_%_%&%_N%_N%aTaaamvaXmaYkaZ [O_\a],E`OT_aa*j O*a/j UY-_a"a*j O*j O*a/j UYhWXh I>$HD:Users:hank:Desktop:Yahoo-AB-1.csv  J 7 7RUX[^adgjmpsvy|  K   "First","Middle","Last","Nickname","Email","Category","Distribution Lists","Messenger ID","Home","Work","Pager","Fax","Mobile","Other","Yahoo! Phone","Primary","Alternate Email 1","Alternate Email 2","Personal Website","Business Website","Title","Company","Work Address","Work City","Work State","Work ZIP","Work Country","Home Address","Home City","Home State","Home ZIP","Home Country","Birthday","Anniversary","Custom 1","Custom 2","Custom 3","Custom 4","Comments","Messenger ID1","Messenger ID2","Messenger ID3","Messenger ID4","Messenger ID5","Messenger ID6","Messenger ID7","Messenger ID8","Messenger ID9","Skype ID","IRC ID","ICQ ID","Google ID","MSN ID","AIM ID","QQ ID"  mS"Matt","","Schickler","","MSchickler@gmail.com","person","Dymec,Lucent","","+1 (603) 434-5248","+1 (978) 688-8807x279","","","+1 (603) 799-0149","","","home","MSchickler@dymec.com","","","","","Dymec","9 Park Ave.","Londonderry","NH","03053","","","","","","","","","","","","","","","","","","","","","","","","","","","","Schickler1",""  "John","","Shaw","","JShaw@dymec.com","person","Dymec","","","+1 (978) 688-8807x216","","","+1 (978) 771-5341","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""  "Mike","","Brown","","MRBrown@dymec.com","person","Dymec","","","+1 (978) 688-8807x202","","","","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""  "Stuart","","Jin","","SJin@dymec.com","person","Dymec","","","+1 (978) 688-8807x245","","","","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""  "Christine","","Kelley","","CKelley@dymec.com","person","Dymec","","","+1 (978) 688-8807x225","","","","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""   "Bill","","Lippitt","","WLippitt@dymec.com","person","Dymec","","","+1 (978) 688-8807x219","","","","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","DymecWL",""  "Hank","","Dolben","","Hank@dolben.org","person","Dymec,Cetacean,Family","","+1-603-436-1511","+1-978-688-8807x286","","","+1-603-674-3306","","","home","HDolben@dymec.com","HDolben@comcast.net","http://dolben.org","","","","","","","","","340 Brackett Rd. ","Rye","NH","03870","United States","2/19/1949","6/17/1972","","","","","","","","","","","","","","","","","","","","ByekRyeder",""   "Pat","","Hofmann","","PHofmann@dymec.com","person","Dymec","","","+1 (703) 257-8986","","","","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","fafaflooey",""  "Bob","","Marcinkowski","","RMarcinkowski@dymec.com","person","Dymec","","","+1 (978) 688-8807x246","","","","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","DymecBM",""  "Ed","","Page","","EPage@dymec.com","person","Dymec","","","+1 (703) 257-8916","","","","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""  "Sebastien","","Richard","","SRichard@dymec.com","person","Dymec","","","+1 (703) 257-8974","","","","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","sebastienatwork",""  "Z","","Opalka","","ZOpalka@dymec.com","person","Dymec","","","+1 (978) 688-8807x283","","","","","","home","","","","","","Dymec","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""  5"","","","","","company","Dymec","","","","","","","+1-978-688-8807","","home","contact@dymec.com","","","http://www.dymec.com","","Dymec, Inc.","25 Commerce Way, #1","N. Andover","MA","01845","USA","","","","","","","","","","","","","","","","","","","","","","","","","","","",""   L  Choose Group M      Cocheco   Dymec   UNH   Swimming   CC_TdF   Cetacean   Family   Lucent  N      Dymec O     N  azf5  kfrmname  azf4 P 7 @Ay  e2   c*-02Yjmpsvy|~ Dymec )+1-978-688-8807 +contact@dymec.com .http://www.dymec.com % Dymec, Inc. -25 Commerce Way, #1 $ N. Andover MA 01845 USA   boovtrue Q  D/Users/hank/Desktop/Yahoo-AB-1.csv R  L/Users/hank/Desktop/Yahoo-AB-1.csv.tmp S  Open in TextEditascr ޭ