FasdUAS 1.101.10 k l  This script sends the currently selected entries of the active BibDesk document to LyX as citations. It does this by `echo`ing a LYXCMD to the user's lyxpipe (the location of the pipe is determined automatically). This is my first bit of apple script so please let me know if there are ways of improving this script. For more information see: http://www.threewordslong.com/projects/misc/bibdesktolyx/ Contact: Mark Reid, 7th June 2005 CHANGELOG: 3rd June 2006 - Update to automatically determine location of LyX pipe (Mark Reid) 27th Feb 2006 - Update to new location of LyX user's directory for 1.4.0 (Bennett Helm) 8th May 2005 - Updated to new location of LyX user's directory (Bennett Helm) 7th June 2005 - Initial Release (Mark Reid) Copyright (C) 2005-2006 Mark Reid This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  l r n  1  psxp l I .earsffdralis afdr m  afdrcusr  from m  fldmfldu o 0 thehomedir theHomeDir  l  r  b  o 0 thehomedir theHomeDir m  71Library/'Application Support'/LyX-1.5/.lyxpipe.in o 0 thelyxpipe150 theLyxPipe150 l r b ! o 0 thehomedir theHomeDir !m" "71Library/'Application Support'/LyX-1.4/.lyxpipe.in o 0 thelyxpipe140 theLyxPipe140#$ #l% %r&' &b() (o 0 thehomedir theHomeDir )m* *3-Library/'Application Support'/LyX/.lyxpipe.in 'o 0 thelyxpipe137 theLyxPipe137$+, +l#- -r#./ .b!01 0o 0 thehomedir theHomeDir 1m 2 2.lyx/lyxpipe.in /o 0 thelyxpipe136 theLyxPipe136,34 3l456 5l7 7[U This checks for the existence of LyX 1.4 pipes first, followed by LyX 1.37 pipes and689 8l: :XR then LyX 1.36 pipes. This means if you have 1.4 and 1.37 installed (or pipes for 9;< ;l= =1+ both) the pipe will be set to 1.4 not 1.37<>? >l$1@ @r$1AB AI$-C .sysoexecTEXTTEXT Cb$)DE Db$'FG Fm$%H Htest -p  Go%& 0 thelyxpipe150 theLyxPipe150 Em'(I I ; echo $?  Bo 0v150?JK Jl2CL Lr2CMN MI2?O .sysoexecTEXTTEXT Ob2;PQ Pb27RS Rm25T Ttest -p  So56 0 thelyxpipe140 theLyxPipe140 Qm7:U U ; echo $?  No 0v140KVW VlDUX XrDUYZ YIDQ[ .sysoexecTEXTTEXT [bDM\] \bDI^_ ^mDG` `test -p  _oGH 0 thelyxpipe137 theLyxPipe137 ]mILa a ; echo $?  Zo 0v137Wbc blVgd drVgef eIVcg .sysoexecTEXTTEXT gbV_hi hbV[jk jmVYl ltest -p  koYZ 0 thelyxpipe136 theLyxPipe136 im[^m m ; echo $?  fo 0v136cno nlopq plhr rZhstu slhov v=howx wohk 0v150 xmkny y0 trrwz{ zors 0 thelyxpipe150 theLyxPipe150 {o 0 thelyxpipe theLyxPipeu|} |lz~ ~=z oz} 0v140 m} 0} r o 0 thelyxpipe140 theLyxPipe140 o 0 thelyxpipe theLyxPipe l = o 0v137 m 0 r o 0 thelyxpipe137 theLyxPipe137 o 0 thelyxpipe theLyxPipe l = o 0v136 m 0 r o 0 thelyxpipe136 theLyxPipe136 o 0 thelyxpipe theLyxPipeq l l :4 Get the selected citations and push to the LyX pipe l^ O^ k] l 71 Collect the keys of the selected citations as a  l  comma separated string r m  o 0cites O k r 1  sele o 0sel Z > o 0sel J X O r b b o 0cites m , l e 1  ckey o 0cites o 0pub 0pub o 0sel l 4  docu m l l 2, Don't do anything if there are no citations Z] > o 0cites m  kY l  Remove leading comma r1 l- n- 7!-  ctxt m') m*, o! 0cites o 0cites l22 l22 -' Create the command to send to the pipe r29 m25 %LYXCMD:BibDesk:citation-insert: o 0 thelyxcmd theLyxCmd r:E l:A b:A o:= 0 thelyxcmd theLyxCmd o=@ 0cites o 0 thelyxcmd theLyxCmd lFF lFF 5/ Send the command to the current user's lyxpipe IFY .sysoexecTEXTTEXT bFU bFQ bFM mFI  echo  oIL 0 thelyxcmd theLyxCmd mMP   >  oQT 0 thelyxpipe theLyxPipe mnull߀ BibDesk.app0$='Ϙ c28t˘Ϙ ~˘lBDSKalisP Macintosh HDqYH+ BibDesk.app"¡# ApplicationsqI %Macintosh HD:Applications:BibDesk.app BibDesk.app Macintosh HDApplications/BibDesk.app/ l .aevtoappnull****~}  | .aevtoappnull**** k^      #+>JVbp{{~} z z0pub 1yxwvuts"r*q2pHIonTUm`allmkyjihgfedcba` y afdrcusr x from w fldmfldu v.earsffdralis afdr u psxp t0 thehomedir theHomeDir s0 thelyxpipe150 theLyxPipe150 r0 thelyxpipe140 theLyxPipe140 q0 thelyxpipe137 theLyxPipe137 p0 thelyxpipe136 theLyxPipe136 o.sysoexecTEXTTEXT n0v150 m0v140 l0v137 k0v136 j0 thelyxpipe theLyxPipe i 0cites h docu g sele f0sel e kocl d cobj c.corecnte******** b ckey a ctxt `0 thelyxcmd theLyxCmd|_l ,EO%EO%EO%EO%EO%%j E`Oa%a%j E`Oa%a%j E`Oa%a%j E`O_a E`Y9_a E`Y'_a E`Y_a E`YhOa a!E`"O*a#k/K*a$,E`%O_%jv71_%[a&a'l (kh_"a)%*a*,E%E`"U[OYYhUO_"a+@_"[a,\[Zl\Zi2E`"Oa-E`.O_._"%E`.Oa/_.%a0%_%j YhUascr ޭ