FasdUAS 1.101.10 k l lf 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: 25th November 2008 - Add support for LyX-1.6 and LyX-2.0 (Bennett Helm) 5th June 2006 - Add future support for LyX-1.5 (Bennett Helm) 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.   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 *at* threewordslong *dot* com> Mark Reid, 7th June 2005 CHANGELOG: 25th November 2008 - Add support for LyX-1.6 and LyX-2.0 (Bennett Helm) 5th June 2006 - Add future support for LyX-1.5 (Bennett Helm) 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 bLibrary/'Application Support'/LyX-2.0/.lyxpipe.in o 0 thelyxpipe20x theLyxPipe20x l r!" !b#$ #o 0 thehomedir theHomeDir $m%%&&bLibrary/'Application Support'/LyX-1.6/.lyxpipe.in "o 0 thelyxpipe16x theLyxPipe16x'( 'l) )r*+ *b,- ,o 0 thehomedir theHomeDir -m..//bLibrary/'Application Support'/LyX-1.5/.lyxpipe.in +o 0 thelyxpipe15x theLyxPipe15x(01 0l#2 2r#34 3b!56 5o 0 thehomedir theHomeDir 6m 7788bLibrary/'Application Support'/LyX-1.4/.lyxpipe.in 4o 0 thelyxpipe14x theLyxPipe14x19: 9l$); ;r$)<= <b$'>? >o$% 0 thehomedir theHomeDir ?m%&@@AAZLibrary/'Application Support'/LyX/.lyxpipe.in =o 0 thelyxpipe137 theLyxPipe137:BC Bl*3D Dr*3EF Eb*/GH Go*+ 0 thehomedir theHomeDir Hm+.IIJJ.lyx/lyxpipe.in Fo 0 thelyxpipe136 theLyxPipe136CKL KlLMN MlOP OKE This checks for the existence of LyX pipes starting from most recentPQQ This checks for the existence of LyX pipes starting from most recentNRS RlTU T versions of LyX.UVV" versions of LyX.SWX Wl4EY Yr4EZ[ ZI4A\ .sysoexecTEXTTEXT \b4=]^ ]b49_` _m47aabbtest -p `o78 0 thelyxpipe20x theLyxPipe20x ^m9<ccdd ; echo $?  [o 0v20xXef elFWg grFWhi hIFSj .sysoexecTEXTTEXT jbFOkl kbFKmn mmFIoopptest -p noIJ 0 thelyxpipe16x theLyxPipe16x lmKNqqrr ; echo $?  io 0v16xfst slXiu urXivw vIXex .sysoexecTEXTTEXT xbXayz ybX]{| {mX[}}~~test -p |o[\ 0 thelyxpipe15x theLyxPipe15x zm]` ; echo $?  wo 0v15xt lj{ rj{ Ijw .sysoexecTEXTTEXT bjs bjo mjmtest -p omn 0 thelyxpipe14x theLyxPipe14x mor ; echo $?  o 0v14x l| r| I| .sysoexecTEXTTEXT b| b| m|test -p o 0 thelyxpipe137 theLyxPipe137 m ; echo $?  o 0v137 l r I .sysoexecTEXTTEXT b b mtest -p o 0 thelyxpipe136 theLyxPipe136 m ; echo $?  o 0v136 l l Z l = o 0v20x m0 r o 0 thelyxpipe20x theLyxPipe20x o 0 thelyxpipe theLyxPipe l = o 0v16x m0 r o 0 thelyxpipe16x theLyxPipe16x o 0 thelyxpipe theLyxPipe l = o 0v15x m0 r o 0 thelyxpipe15x theLyxPipe15x o 0 thelyxpipe theLyxPipe l = o 0v14x m0 r o 0 thelyxpipe14x theLyxPipe14x o 0 thelyxpipe theLyxPipe l = o 0v137 m0 r o 0 thelyxpipe137 theLyxPipe137 o 0 thelyxpipe theLyxPipe l = o 0v136 m0 r o 0 thelyxpipe136 theLyxPipe136 o 0 thelyxpipe theLyxPipe l l :4 Get the selected citations and push to the LyX pipeh Get the selected citations and push to the LyX pipe l O k l 71 Collect the keys of the selected citations as a b Collect the keys of the selected citations as a  l  comma separated string. comma separated string r   m     o 0cites   O s k)r r)2 1).  sele o 0sel Z3r >39 o36~ ~0sel J68}} X<n| ORi rVh bVd!" !bV]#$ #oVY{ { 0cites $mY\%%&&, "l]c'zy 'e]c( (1]cx x ckeyzy  ow w 0cites oRSv v0pub |0pub o?Bu u0sel l &)ts )4 &r* r docu *m$%qqts+, +lttponpon,-. -lttm/0m /2, Don't do anything if there are no citations011X Don't do anything if there are no citations.2l 2Zt34kj 3>t{56 5otwi i 0cites 6mwz7788 4k~99:; :l~~h<=h < Remove leading comma=>>* Remove leading comma;?@ ?r~AB Al~Cgf Cn~DE D7eFG e ctxt Fmdd Gmcc Eo~b b 0citesgf Boa a 0cites@HI Hl`_^`_^IJK Jl]LM] L-' Create the command to send to the pipeMNNN Create the command to send to the pipeKOP OrQR QmSSTT>LYXCMD:BibDesk:citation-insert: Ro\ \0 thelyxcmd theLyxCmdPUV UrWX WlY[Z YbZ[ ZoY Y0 thelyxcmd theLyxCmd [oX X 0cites[Z XoW W0 thelyxcmd theLyxCmdV\] \lVUTVUT]^_ ^lS`aS `5/ Send the command to the current user's lyxpipeabb^ Send the command to the current user's lyxpipe_cR cIQdP Q.sysoexecTEXTTEXT dbef ebgh gbij imkkll echo joO O0 thelyxcmd theLyxCmd hmmmnn > foN N0 thelyxpipe theLyxPipePRkjl mooBDSKalisT Macintosh HDxH+n BibDesk.app'NQ TeXyE?N(n<)Macintosh HD:Applications:TeX:BibDesk.app BibDesk.app Macintosh HDApplications/TeX/BibDesk.app/pM plLKJLKJMIqrIqH H.aevtoappnull****rGsFEtuD G.aevtoappnull**** skvv wwxxyy'zz0{{9||B}}W~~esCCFEtB B0pubu=A@?>=<;%:.978@7I6ac54oq3}210/.o -,+*)('%&7%S$km A afdrcusr @ from ? fldmfldu >.earsffdralis afdr = psxp <0 thehomedir theHomeDir ;0 thelyxpipe20x theLyxPipe20x :0 thelyxpipe16x theLyxPipe16x 90 thelyxpipe15x theLyxPipe15x 80 thelyxpipe14x theLyxPipe14x 70 thelyxpipe137 theLyxPipe137 60 thelyxpipe136 theLyxPipe136 5.sysoexecTEXTTEXT 40v20x 30v16x 20v15x 10v14x 00v137 /0v136 .0 thelyxpipe theLyxPipe - 0cites , docu + sele *0sel ) kocl ( cobj '.corecnte******** & ckey % ctxt $0 thelyxcmd theLyxCmdDl ,EO%EO%EO%EO%EO%EOa%E`Oa%a%j E`Oa%a%j E`Oa%a%j E`Oa%a%j E`Oa%a %j E`!Oa"_%a#%j E`$O_a% E`&Y__a' E`&YM_a( E`&Y;_a) E`&Y)_!a* E`&Y_$a+ _E`&YhOa,a-E`.O*a/k/K*a0,E`1O_1jv71_1[a2a3l 4kh_.a5%*a6,E%E`.U[OYYhUO_.a7@_.[a8\[Zl\Zi2E`.Oa9E`:O_:_.%E`:Oa;_:%a<%_&%j YhUascr ޭ