> On 28 Dec 2020, at 17:15, Ronald Haynes <[email protected]> wrote:
> 
> Hi folks, so I have made some progress with links to attachments using a .bib 
> file generated by zotero/better-bibtex.  All entries work except for entries 
> with multiple attachments.  Several of my .bib entries have file fields that 
> look like:
> 
> /Users/rhaynes/Zotero/storage/QYXFGM6P/Peña_1995_M-matrices whose inverses 
> are totally 
> positive.pdf;/Users/rhaynes/Zotero/storage/ZQNHFBL9/002437959300244T.html
> 
> 
> Bibdesk is not able to decipher the link to the pdf file.      Any 
> suggestions? 
> 
> Sincerely,
> 
> Dr. Ronald D. Haynes
> 
> Professor, Department of Mathematics and Statistics
> Chair, MSc and PhD Scientific Computing Programs
> Memorial University of Newfoundland

BibDesk cannot by itself understand multiple files in the same field. It is 
also ambiguous, as the semicolon is also a valid path character.

You could try to use AppleScript to convert these fields into linked files. I 
don’t know if you are versed in AppleScript?

The following script should do what you want (disclaimer: not fully tested, as 
I don’t have these fields).

tell application "BibDesk"
        tell front document
                set AppleScript's text item delimiters to {";"}
                repeat with aPub in publications
                        tell (contents of aPub)
                                set theValue to value of field "File"
                                if theValue contains ";" then
                                        set theFileNames to text items of 
theValue
                                        repeat with theFileName in theFileNames
                                                set theFileName to contents of 
theFileName
                                                if theFileName ≠ "" then
                                                        set theFile to resolve 
theFileName
                                                        try
                                                                theFile as alias
                                                                if (get linked 
files) does not contain theFile then
                                                                        add 
theFile
                                                                end if
                                                        end try
                                                end if
                                        end repeat
                                end if
                        end tell
                end repeat
                set AppleScript's text item delimiters to {""}
        end tell
end tell

Christiaan

_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to