Skip to content

Instantly share code, notes, and snippets.

@deeplycloudy
Created March 13, 2015 04:05
Show Gist options
  • Save deeplycloudy/7f73854a55a97a915751 to your computer and use it in GitHub Desktop.
Save deeplycloudy/7f73854a55a97a915751 to your computer and use it in GitHub Desktop.
Get a list of collaborators on all papers in the last N years
-- This script is meant for use with BibDesk.
-- I wrote it to automate generation of a list of collaborators for the NSF biographical sketch.
-- You'll need to edit this list, but it automates the first step.
-- Usage: Highlight all of publications of interest
-- (e.g., search for your name in the search field and select all) and then run this script.
set thisYear to the year of (current date)
set namelist to {}
set yearlist to {}
tell application "BibDesk"
set theSelection to the selection of document 0
repeat with thePub in theSelection
set pubYear to (publication year) of thePub
if ((thisYear - pubYear) < 5) then
if pubYear is not in yearlist then set end of my yearlist to pubYear
set theAuthors to authors of thePub
repeat with anAuthor in theAuthors
set thisName to name of anAuthor
if thisName is not in namelist then set end of my namelist to thisName
end repeat
end if
end repeat
end tell
{namelist, yearlist}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment