FasdUAS 1.101.10 k l & PubMed to BibTex (Applescript) l   (by Brian Hargreaves)  l   l 93 This script takes an entry, or entries copied from l 82 a Pub-Med listing, and parses the text to extract l ?9 author, journal, volume, number, page, year information. l ?9 Each entry is displayed for editing in a dialog box, and l >8 the user can put the edited entry back on the clipboard l +% and open a .bib file to paste it in. l !" !l# # INSTRUCTIONS:"$% $l%&' &l( (MG 1) Set the bibfile below to your .bib file, and the terminal editor to')* )l+ +(" vi or emacs, or possibly "open"*,- ,l. .F@ 2) Set the perlscript path to whereever you put the file pmb-as-/0 /l1 1 3) Do a Pub-Med search.023 2l4 493 4) Copy, everything from the first author name to 356 5l7 7)# the PMID line ending at ']' 689 8l: :3- (It is often easier to copy from bottom up)9;< ;l= = 5) Run this applescript.<>? >l?@A @lB B  Notes:ACD ClE E5/ -Attempts to abbreviate journal names, so you DFG FlH H5/ need to translate these in your .bib file. GIJ IlJKL KlM M% Please send me your comments!!LNO NlOPQ PlQRS RlSTU TlV VrWX WmY Y%/Users/brian/tex/bib/bhrefs.bib Xo 0bibfileUZ[ Zl\ \r]^ ]m_ _4./Users/brian/Library/Scripts/perl/pubmedbib.pl ^o 0 perlscript[`a `l b br cd cm e e ---***--- do 0 delimiterafg fl h hr ij im k kvi jo 0terminaleditorglm llmno nlopq plqrs rlYt tQYuvw uk2xxyz yl{ {!tell application "TextEdit"z|} |l~ ~ activate} l  open file bibfile l end tell l l l r I .JonsgClp****@null  rtyp m  TEXT o 0 this_data Z0 l" A" n 1  leng o 0 this_data m ! I%* .sysodlogaskrTEXT m%& #Not enough data on clipboard. k-0 r-J l-F I-F .sysoexecTEXTTEXT b-B b-@ b-< b-: b-6 m-0 echo  n05 115  strq o01 0 this_data m69 |  o:; 0 perlscript m<?   o@A 0bibfile o 0bibentry lKK rKX IKT 0 texttolist TextToList oLO 0bibentry oOP 0 delimiter o 0biblist rYb nY^ 1\^  leng oY\ 0biblist o 0lbl lcc 2,display dialog "Number of entries is " & lbl rcl cch mcd mdg  long o 0bibcount lmm Xm0 k+ l Z+ l ? n 1  leng o 0bibitem m k r [ o 0bibcount m o 0bibcount I .sysodlogaskrTEXT b b b b b m !PubMed to BibTex --- Entry  o 0bibcount m  of  o 0lbl m  to add: o  ret   dtxt o 0bibitem  btns J m Copy & Open .bib file m  Just Copy m  Skip Entry  dflt m r 1  rslt o 0myresult r   n   1  ttxt  o  0myresult  o~ ~0 editedbibitem   r n 1} } bhit o| | 0myresult o{ {0 thebutton theButton Zzy > ox x0 thebutton theButton m  Skip Entry Iwv w.JonspClpnull**** ou u0 editedbibitemvzy ltsts lrr nhdisplay dialog "Bib Entry:" & return & return & bibentry buttons {"Cancel", "Continue"} default button 2 !  lqpqp!"o "Z#$nm #=%& %ol l0 thebutton theButton &m' 'Copy & Open .bib file $O () (Ik*j k.coredoscnullTEXT *b+, +b-. -oi i0terminaleditor .m/ /  ,oh h 0bibfilej )m  00null!ߠ Terminal.app0L7 :|)(K @trmxalisj Macintosh HD,H+ Terminal.appa¼ g Utilities-/4 0 0Macintosh HD:Applications:Utilities:Terminal.app Terminal.app Macintosh HD#Applications/Utilities/Terminal.app/nmo k"+1123 2I")g4f g.sysodlogaskrTEXT 4m"%5 5!Error parsing Pub-Med text.f36e 6l**dcdce 0bibitem opsb b 0biblist7a 7l11`_`_a vR^89 ^.ascrerr ******** 8o] ]0 error_message9\:[ \ errn :l;Z ;oY Y0 error_numberZ[ wZ:Y<=XW <>:?>? >l:;@V @o:;U U0 error_numberV ?m;>TT =IBUSAB S.sysodlogaskrTEXT AoBCR R0 error_messageBQCD Q btns CJFKEEFP FmFIG GOKPDOHN O dflt HmNOMMNXWsIJ IlLKLKJKL KlJIJILMN MiOP OIHQG H0 texttolist TextToListQRS RoF F0thetexttheTextSTE ToD D0 thedelimiter theDelimiterEG Pk3UUVW VrXY XnZ[ Z1C C txdl [1B B ascr YoA A0 savedelim saveDelimW\] \Q*^_` ^k aabc br de dJ ffg@ go ? ?0 thedelimiter theDelimiter@ enhi h1 > > txdl i1 = = ascrcj< jrkl knmn m2; ; citm no: :0thetexttheText lo9 90thelisttheList< _R8op 8.ascrerr ******** oo7 70errstrerrStrp6q5 6 errn qo4 40errnumerrNum5 `k*rrst sr#uv uo3 30 savedelim saveDelim vnwx w1 "2 2 txdl x1 1 1 ascrty0 yR$*/z{ /.ascrerr ******** zo(). .0errstrerrStr{-|, - errn |o&'+ +0errnumerrNum,0]}~ }r+0 o+,* *0 savedelim saveDelim n 1-/) ) txdl 1,-( ( ascr~' L13 l12& o12% %0thelisttheList&'N l$#$#" l! ! "Y_ek 0 texttolist TextToList .aevtoappnull****  0bibfile 0 perlscript  0 delimiter 0terminaleditor  0 this_data  0bibentry  0biblist 0lbl  0bibcount  0myresult 0 editedbibitem 0 thebutton theButton   P  0 texttolist TextToList  0thetexttheText 0 thedelimiter theDelimiter 0thetexttheText 0 thedelimiter theDelimiter 0 savedelim saveDelim 0thelisttheList 0errstrerrStr 0errnumerrNum  ascr  txdl  citm 0errstrerrStr  errn 0errnumerrNum  errn4,EOkv,FO-EWX,FO)lO,FO .aevtoappnull**** kYTZ`fr 0bibitem 0 error_message 0 error_number;Y_ek'0/5G 0bibfile 0 perlscript 0 delimiter 0terminaleditor  rtyp  TEXT .JonsgClp****@null 0 this_data  leng .sysodlogaskrTEXT  strq .sysoexecTEXTTEXT 0bibentry 0 texttolist TextToList 0biblist 0lbl  long 0bibcount  kocl  cobj .corecnte********  ret  dtxt  btns  dflt  rslt 0myresult  ttxt 0 editedbibitem  bhit 0 thebutton theButton .JonspClpnull**** .coredoscnullTEXT 0 error_message  errn 0 error_numberZEOEOEOEO$*l EO, j Yaa,%a%%a%%j E`O*_l+E`O_,E`Oja&E`O_[aal kh,_kE`Oa_%a%_%a %_!%a"a#a$a%a&mva'ka( O_)E`*O_*a+,E`,O_*a-,E`.O_.a/ _,j 0YhO_.a1a2 a3%%j 4UYhY a5j OP[OYROPW&X67a8a#a9kva'ka: Yh 2: Nayak KS, Hu BS, Nishimura DG. Related Articles, Links Rapid quantitation of high-speed flow jets. Magn Reson Med. 2003 Aug;50(2):366-72. PMID: 12876713 [PubMed - indexed for MEDLINE] 23: Miller KL, Pauly JM. Related Articles, Links Nonlinear phase correction for navigated diffusion imaging. Magn Reson Med. 2003 Aug;50(2):343-53. PMID: 12876711 [PubMed - indexed for MEDLINE] 24: Hargreaves BA, Vasanawala SS, Nayak KS, Hu BS, Nishimura DG. Related Articles, Links Fat-suppressed steady-state free precession imaging using phase detection. Magn Reson Med. 2003 Jul;50(1):210-3. PMID: 12815698 [PubMed - indexed for MEDLINE] 25: Beaulieu CF, Gold GE. Related Articles, Links Interactive and interventional sports medicine imaging. Top Magn Reson Imaging. 2003 Apr;14(2):115-30. Review. PMID: 12777885 [PubMed - indexed for MEDLINE] 26: Yang PC, Meyer CH, Terashima M, Kaji S, McConnell MV, Macovski A, Pauly JM, Nishimura DG, Hu BS. Related Articles, Links Spiral magnetic resonance coronary angiography with rapid real-time localization. J Am Coll Cardiol. 2003 Apr 2;41(7):1134-41. PMID: 12679213 [PubMed - indexed for MEDLINE] 27: Hargreaves BA, Gold GE, Beaulieu CF, Vasanawala SS, Nishimura DG, Pauly JM. Related Articles, Links Comparison of new sequences for high-resolution cartilage imaging. Magn Reson Med. 2003 Apr;49(4):700-9. PMID: 12652541 [PubMed - indexed for MEDLI p @article{Nayak2003, author= {K.~S.~Nayak and B.~S.~Hu and D.~G.~Nishimura}, title= {Rapid quantitation of high-speed flow jets}, journal= mrm, volume= {50}, number= {2}, pages= {366--372}, year= {2003} } ---***--- @article{Miller2003, author= {K.~L.~Miller and J.~M.~Pauly}, title= {Nonlinear phase correction for navigated diffusion imaging}, journal= mrm, volume= {50}, number= {2}, pages= {343--353}, year= {2003} } ---***--- @article{Hargreaves2003, author= {B.~A.~Hargreaves and S.~S.~Vasanawala and K.~S.~Nayak and B.~S.~Hu and D.~G.~Nishimura}, title= {Fat-suppressed steady-state free precession imaging using phase detection}, journal= mrm, volume= {50}, number= {1}, pages= {210--213}, year= {2003} } ---***--- @article{Beaulieu2003, author= {C.~F.~Beaulieu and G.~E.~Gold}, title= {Interactive and interventional sports medicine imaging}, journal= tmri, volume= {14}, number= {2}, pages= {115--130}, year= {2003} } ---***--- @article{Yang2003, author= {P.~C.~Yang and C.~H.~Meyer and M.~Terashima and S.~Kaji and M.~V.~McConnell and A.~Macovski and J.~M.~Pauly and D.~G.~Nishimura and B.~S.~Hu}, title= {Spiral magnetic resonance coronary angiography with rapid real-time localization}, journal= {"J Am Coll Cardiol"}, volume= {41}, number= {7}, pages= {1134--1141}, year= {2003} } ---***--- @article{Hargreaves2003, author= {B.~A.~Hargreaves and G.~E.~Gold and C.~F.~Beaulieu and S.~S.~Vasanawala and D.~G.~Nishimura and J.~M.~Pauly}, title= {Comparison of new sequences for high-resolution cartilage imaging}, journal= mrm, volume= {49}, number= {4}, pages= {700--709}, year= {2003} }  @article{Nayak2003, author= {K.~S.~Nayak and B.~S.~Hu and D.~G.~Nishimura}, title= {Rapid quantitation of high-speed flow jets}, journal= mrm, volume= {50}, number= {2}, pages= {366--372}, year= {2003} } 4 @article{Miller2003, author= {K.~L.~Miller and J.~M.~Pauly}, title= {Nonlinear phase correction for navigated diffusion imaging}, journal= mrm, volume= {50}, number= {2}, pages= {343--353}, year= {2003} }  @article{Hargreaves2003, author= {B.~A.~Hargreaves and S.~S.~Vasanawala and K.~S.~Nayak and B.~S.~Hu and D.~G.~Nishimura}, title= {Fat-suppressed steady-state free precession imaging using phase detection}, journal= mrm, volume= {50}, number= {1}, pages= {210--213}, year= {2003} }  @article{Beaulieu2003, author= {C.~F.~Beaulieu and G.~E.~Gold}, title= {Interactive and interventional sports medicine imaging}, journal= tmri, volume= {14}, number= {2}, pages= {115--130}, year= {2003} }  @article{Yang2003, author= {P.~C.~Yang and C.~H.~Meyer and M.~Terashima and S.~Kaji and M.~V.~McConnell and A.~Macovski and J.~M.~Pauly and D.~G.~Nishimura and B.~S.~Hu}, title= {Spiral magnetic resonance coronary angiography with rapid real-time localization}, journal= {"J Am Coll Cardiol"}, volume= {41}, number= {7}, pages= {1134--1141}, year= {2003} } ( @article{Hargreaves2003, author= {B.~A.~Hargreaves and G.~E.~Gold and C.~F.~Beaulieu and S.~S.~Vasanawala and D.~G.~Nishimura and J.~M.~Pauly}, title= {Comparison of new sequences for high-resolution cartilage imaging}, journal= mrm, volume= {49}, number= {4}, pages= {700--709}, year= {2003} }   ttxt( @article{Hargreaves2003, author= {B.~A.~Hargreaves and G.~E.~Gold and C.~F.~Beaulieu and S.~S.~Vasanawala and D.~G.~Nishimura and J.~M.~Pauly}, title= {Comparison of new sequences for high-resolution cartilage imaging}, journal= mrm, volume= {49}, number= {4}, pages= {700--709}, year= {2003} }   bhitSkip Entryascr ޭ