Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tell application "BibDesk"
- set theDoc to document 1
- tell theDoc
- set theSel to selection
- set thePub to item 1 of theSel
- tell thePub
- -- current (probably empty?) BibTeX record
- set curBibTeXRecord to get BibTeX string of thePub
- -- get the BibTeX record using pdfmeat.py. Wrap it in a shell script because it needs a full path, write access to a folder, etc.
- set theFile to get linked files
- set thePath to POSIX path of theFile
- set shellOpts to "cd /tmp; PATH=$PATH:/usr/local/bin "
- set pdfMeatCmd to "/Users/mankoff/bin/python /Users/mankoff/bin/pdfmeat.py "
- set shellCmd to shellOpts & pdfMeatCmd & "'" & thePath & "'"
- --set pdfMeatOutput to do shell script shellCmd
- -- For debugging, don't query Google Scholar
- set pdfMeatOutput to "@article{McCracken:2005, Author = {M. McCracken and A. Maxwell}, Title = {Working with BibDesk.},Year={2005}}"
- display dialog pdfMeatOutput
- end tell
- set newPub to import from pdfMeatOutput
- tell newPub
- make new linked file with data theFile at beginning of linked files
- end tell
- --delete thePub
- end tell
- end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement