Here is another variant of the AppleScript. if you run this, the fields with 
more file names will be split into fields like File1, File2, etc. If you run 
the Convert File and URL Fields action after running this script, and after you 
have registered these extra fields also as Local File fields (as many as you 
need, the script should return the maximum added number to add that you need), 

tell application "BibDesk"
        tell front document
                set AppleScript's text item delimiters to {";"}
                set theMax to 0
                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
                                        set i to 0
                                        repeat with theFileName in theFileNames
                                                set theFileName to contents of 
theFileName
                                                if theFileName ≠ "" then
                                                        set theFieldName to 
"File"
                                                        if i > 0 then set 
theFieldName to theFieldName & i
                                                        set value of field 
theFieldName to theFileName
                                                        set i to i + 1
                                                end if
                                                if i > theMax + 1 then set 
theMax to i - 1
                                        end repeat
                                end if
                        end tell
                end repeat
                set AppleScript's text item delimiters to {""}
                return theMax
        end tell
end tell

Christiaan

> On 29 Dec 2020, at 00:08, Ronald Haynes <[email protected]> wrote:
> 
> Correct! A hack for sure to get up and running with bibdesk. 
> 
> Sincerely,
> 
> Dr. Ronald D. Haynes
> 
> Professor, Department of Mathematics and Statistics
> Chair, MSc and PhD Scientific Computing Programs
> Memorial University of Newfoundland
> 
> We acknowledge that the lands on which Memorial University’s campuses are 
> situated are in the traditional territories of diverse Indigenous groups, and 
> we acknowledge with respect the diverse histories and cultures of the 
> Beothuk, Mi’kmaq, Innu, and Inuit of this province.
> On Dec 28, 2020, 7:35 PM -0330, Christiaan Hofman <[email protected]>, wrote:
>> That looks like it just drops the second file. Also problematic when 
>> anything else, like a title, has a semicolon in it.
>> 
>> Christiaan
>> 
>>> On 28 Dec 2020, at 22:09, Ronald Haynes <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Hi folks, I was able to conjure up a little vi magic to handle this:
>>> 
>>> :%s/;.*/}/
>>> 
>>> Sincerely,
>>> 
>>> Dr. Ronald D. Haynes
>>> 
>>> Professor, Department of Mathematics and Statistics
>>> Chair, MSc and PhD Scientific Computing Programs
>>> Memorial University of Newfoundland

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

Reply via email to