Here is an example script to add crossers for incollection items to 
corresponding book items:

tell application "BibDesk"
        tell front document
                set thePubs to publications where its type is "incollection" 
and its value of field "Crossref" is ""
                set theBooks to publications where its type is "book" and its 
value of field "Crossref" is ""
                repeat with thePub in thePubs
                        set thePub to contents of thePub
                        tell thePub
                                set theBooktitle to value of field "Booktitle"
                                set thePublisher to value of field "Publisher"
                                set theYear to value of field "Year"
                                if theBooktitle is not "" and thePublisher is 
not "" and theYear is not "" then
                                        repeat with theBook in theBooks
                                                set theBook to contents of 
theBook
                                                if value of field "Booktitle" 
of theBook is theBooktitle and ¬
                                                        value of field 
"Publisher" of theBook is thePublisher and ¬
                                                        value of field "Year" 
of theBook is theYear then
                                                        set value of field 
"Crossref" to cite key of theBook
                                                        set value of field 
"Booktitle" to ""
                                                        set value of field 
"Publisher" to ""
                                                        set value of field 
"Year" to ""
                                                        exit repeat
                                                end if
                                        end repeat
                                end if
                        end tell
                end repeat
        end tell
end tell

You may modify the script to handle other types you may want to crossref, but 
you’d think of some logic to do that.

Christiaan

_______________________________________________
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to