Skip to content

Instantly share code, notes, and snippets.

@derickfay
Created April 12, 2017 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derickfay/685d88612c48a8c9c7a363673e59da4a to your computer and use it in GitHub Desktop.
Save derickfay/685d88612c48a8c9c7a363673e59da4a to your computer and use it in GitHub Desktop.
BibDesk AppleScript to look up missing publisher locations
tell application "BibDesk"
activate
-- 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 the selection of document 1
repeat with thePub in thePublications
set thePublisher to the value of field "publisher" of thePub
if thePublisher contains "Harvard" then
set the value of field "address" of thePub to "Cambridge, MA"
else if thePublisher contains "Wisconsin" then
set the value of field "address" of thePub to "Madison"
else if thePublisher contains "Duke" then
set the value of field "address" of thePub to "Durham, NC"
else if thePublisher contains "Chicago" then
set the value of field "address" of thePub to "Chicago"
else if thePublisher contains "Pluto" then
set the value of field "address" of thePub to "London"
else if thePublisher contains "Oxford" then
set the value of field "address" of thePub to "Oxford"
else if thePublisher contains "Clarendon" then
set the value of field "address" of thePub to "Oxford"
else if thePublisher contains "Indiana" then
set the value of field "address" of thePub to "Bloomington"
else if thePublisher contains "of California" then
set the value of field "address" of thePub to "Berkeley"
else if thePublisher contains "Ohio" then
set the value of field "address" of thePub to "Athens"
else if thePublisher contains "Human Sciences Research Council" then
set the value of field "address" of thePub to "Pretoria"
else if thePublisher contains "Stanford" then
set the value of field "address" of thePub to "Palo Alto"
else if thePublisher contains "Earthscan" then
set the value of field "address" of thePub to "London"
else if thePublisher contains "Macmillan" then
set the value of field "address" of thePub to "New York, NY"
else if thePublisher contains "Ravan" then
set the value of field "address" of thePub to "Braamfontein"
else if thePublisher contains "Guilford" then
set the value of field "address" of thePub to "New York, NY"
else if thePublisher contains "Routledge" then
set the value of field "address" of thePub to "London"
else if thePublisher contains "Palgrave" then
set the value of field "address" of thePub to "Basingstoke"
else if thePublisher contains "Washington" then
set the value of field "address" of thePub to "Seattle"
else if thePublisher contains "Cambridge U" then
set the value of field "address" of thePub to "Cambridge"
else if thePublisher contains "Virginia" then
set the value of field "address" of thePub to "Charlottesville"
else if thePublisher contains "Blackwell" then
set the value of field "address" of thePub to "London"
else if thePublisher contains "Berghahn" then
set the value of field "address" of thePub to "Oxford"
else if thePublisher contains "David Philip" then
set the value of field "address" of thePub to "Cape Town"
else if thePublisher contains "James Currey" then
set the value of field "address" of thePub to "Oxford"
else if thePublisher contains "Heinemann" then
set the value of field "address" of thePub to "Portsmouth, NH"
else if thePublisher contains "Berg" then
set the value of field "address" of thePub to "Oxford"
else if thePublisher contains "AltaMira" then
set the value of field "address" of thePub to "Lanham, MD"
else if thePublisher contains "Heinemann" then
set the value of field "address" of thePub to "Portsmouth, NH"
else if thePublisher contains "Brill" then
set the value of field "address" of thePub to "Leiden"
else if thePublisher contains "Free Press" then
set the value of field "address" of thePub to "New York, NY"
else if thePublisher contains "Penguin" then
set the value of field "address" of thePub to "London"
else if thePublisher contains "KwaZulu" then
set the value of field "address" of thePub to "Durban"
else if thePublisher contains "Zed" then
set the value of field "address" of thePub to "London"
else if thePublisher contains "Jonathan Ball" then
set the value of field "address" of thePub to "Jeppestown, South Africa"
else if thePublisher contains "Westview" then
set the value of field "address" of thePub to "Boulder, CO"
else if thePublisher contains "Princeton" then
set the value of field "address" of thePub to "Princeton"
else if thePublisher contains "Michigan" then
set the value of field "address" of thePub to "Ann Arbor"
else if thePublisher contains "Manchester" then
set the value of field "address" of thePub to "Manchester"
else if thePublisher contains "Columbia" then
set the value of field "address" of thePub to "New York, NY"
else if thePublisher contains "Natural History" then
set the value of field "address" of thePub to "Garden City, NY"
else if thePublisher contains "Texas" then
set the value of field "address" of thePub to "Austin"
else if thePublisher contains "Cornell" then
set the value of field "address" of thePub to "Ithaca"
else if thePublisher contains "Yale" then
set the value of field "address" of thePub to "New Haven"
else if thePublisher contains "Athlone" then
set the value of field "address" of thePub to "London"
else if thePublisher contains "Allyn & Bacon" then
set the value of field "address" of thePub to "Boston"
else if thePublisher contains "Basic" then
set the value of field "address" of thePub to "New York"
else if thePublisher contains "Left Coast Press" then
set the value of field "address" of thePub to "Walnut Creek"
else if thePublisher contains "Polity" then
set the value of field "address" of thePub to "Cambridge"
else if thePublisher contains "MIT Press" then
set the value of field "address" of thePub to "Cambridge"
else if thePublisher contains "University of Georgia" then
set the value of field "address" of thePub to "Athens"
end if
end repeat
set selection of document 1 to thePublications
end tell -- Bibdesk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment