Last active
January 3, 2016 13:39
-
-
Save gglanzani/8471281 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (* | |
| PapersToBibDesk: To transfer citations from Papers to formatlib and | |
| auto-generate a citekey. | |
| Place this in ~/Library/Scripts/Applications/Papers | |
| Create this folder if necessary. | |
| Select the references you wish to transfer in Papers first. | |
| Then run the script. | |
| Make the pause longer if you are getting errors. | |
| *) | |
| set pause to 0.7 -- adjust as needed | |
| -- make as short as possible without errors | |
| tell application "Papers.app" | |
| activate | |
| end tell | |
| tell application "System Events" | |
| tell process "Papers" | |
| tell menu bar 1 | |
| tell menu bar item "File" | |
| tell menu "File" | |
| tell menu item "Export..." | |
| tell menu "Export..." | |
| click menu item "BibTeX Library" | |
| end tell | |
| end tell | |
| end tell | |
| end tell | |
| end tell | |
| end tell | |
| keystroke "~/Desktop/from_papers.bib" | |
| keystroke return | |
| delay pause * 25 | |
| keystroke return | |
| delay pause * 25 -- again: adjust as needed | |
| end tell | |
| do shell script "export PATH=/format/lib/path && formatlib ~/Desktop/from_papers.bib" | |
| delay pause * 4 | |
| do shell script "rm ~/Desktop/from_papers.old.bib" --clean up | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment