I'm glad this script is helpful for you with some modifications.

As I note in the script, the script assumes a cite key in format 
thePrefix:theSuffix (for example, First Author + : + Year + 2 Unique Letters, 
or 
Smith:2007ya, which is the default in my version of BibDesk). If your cite keys 
have a different format (for example, Sci:Smith:2007ya or Smith2007ya), you 
will 
have to edit the script so that it works with your cite keys.

Because the Mac OS path delimiter is ":" (rather than the POSIX delimiter "/"), 
a cite key in format Smith:2007ya has a metadata cache file with the Mac OS 
filename "Smith/2007ya.bdskcache" (at least, this is true in Mac OS X 10.4, 
which I am using). The part of the script that did not work for you is devoted 
to dealing with the Mac OS treatment of colons in filenames.

Best wishes!

At 2010-08-07 14:31 Janosch Linkersdörfer wrote:

> Hi,
> 
> Thank you very much for this script. It works with DEVONthink, too...
> One thing, though: I had to erase 
> 
> "/" & theSuffix 
> 
> from the line
> 
> set theCachePath to (path to home folder as text) &
> "Library:Caches:Metadata:edu.ucsd.cs.mmccrack.bibdesk:" & thePrefix &
> "/" & theSuffix & ".bdskcache"
> 
> to get it to work. It seems that your
> /Library/Caches/Metadata/edu.ucsd...-folder has folders inside named
> with the citekeys and in that folders are the cache files?! My cache
> files just lie in the edu.ucsd...-folder...
> 
> Thanks again and all the best,
> 
> Januz
> 
> Am 07.08.2010 um 06:21 schrieb slow down:
> 
> > Here's an AppleScript that I use for BibDesk-Journler integration.
> > Please post it to the wiki if you think it would be useful to others!
> > 
> > (*
> > This script reveals in a Finder window the BibDesk metadata cache files
> > of the publications selected in the front document. Hence, it should be
> > run after your BibTeX document has been saved in BibDesk and the
> > metadata cache files have been automatically written to disk. Opening
> > any of these cache files will select the corresponding publications in
> > the BibDesk document. This is how I use the script in my workflow: While
> > writing in Journler, when I want to link to a publication in BibDesk, I
> > switch to BibDesk and I select the publications to which I want to link.
> > Then I run this script. Then I drag the selected files into my Journler
> > text, where they appear as hyperlinked cite keys. Henceforth, clicking
> > on any of the cite keys in the Journler text automatically selects the
> > publication in BibDesk.
> > *)
> > 
> > tell application "BibDesk"
> > -- without document, there is no selection, so nothing to do
> > if (count of documents) = 0 then
> > beep
> > display dialog "No documents found." buttons {"•"} default button 1
> > giving up after 3
> > end if
> > set thePublications to selection of document 1
> > end tell
> > set listOfPaths to {}
> > repeat with thePub in thePublications
> > tell application "BibDesk"
> > -- get the cite key of the selected document and parse it into a
> > bdskcache filename; assumes standard BibDesk cite key format with one
> > colon, i.e. "thePrefix:theSuffix"
> > set theCiteKey to the cite key of thePub as string
> > set thePrefix to text 1 thru ((offset of ":" in theCiteKey) - 1) of
> > theCiteKey
> > set thePrefix to thePrefix as string
> > set theSuffix to text ((offset of ":" in theCiteKey) + 1) thru -1 of
> > theCiteKey
> > set theSuffix to theSuffix as string
> > set theCachePath to (path to home folder as text) &
> > "Library:Caches:Metadata:edu.ucsd.cs.mmccrack.bibdesk:" & thePrefix &
> > "/" & theSuffix & ".bdskcache"
> > set theCachePath to theCachePath as alias
> > copy theCachePath as alias to the end of listOfPaths
> > end tell
> > end repeat
> > tell application "Finder"
> > reveal listOfPaths
> > activate
> > end tell



      

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to