Add keywords to many entries of BibDesk at the same time

The following AppleScript performs the above function:
tell application "BibDesk"
    set theSelection to the selection of document 1
    display dialog "Give the new keywords separated by commas:" default answer "" buttons {"Cancel", "OK"} default button 2
    set the newKeywords to the text returned of the result
    repeat with thePub in theSelection
        set oldKeywords to keywords of thePub
        if oldKeywords is "" then
            set keywords of thePub to newKeywords
            set keywords of thePub to keywords of thePub & ", " & newKeywords
        end if
    end repeat
end tell

No comments: