Skip to content

Instantly share code, notes, and snippets.

@cfriedline
Last active August 29, 2015 14:04
Show Gist options
  • Save cfriedline/3b55323a5cc695eadede to your computer and use it in GitHub Desktop.
Save cfriedline/3b55323a5cc695eadede to your computer and use it in GitHub Desktop.
Workflow for importing a foreign library to Papers3

#Workflow for importing a foreign library to Papers3

the idea is to write down workflow ideas and their features/flaws using the AppleScript API in papers 3.

##Starting material

  1. exported bib or xml from Sente
  2. a directory of PDFs in the Sente/Contents/Attachments directory

##Current Ideas

Idea 1

Import the XML file and use the API to match related-urls file:// with actual file on the disk

Problem:

  • can't create a primary file item directly in code to attach to a publication item

Idea 2

Import the PDF files (without reorganizing or renaming them) to create primary file items, then import the xml/bib.

Problem:

  • creates duplicates
  • no easy way to merge them

Idea 3

Import the PDF files (without reorganizing or renaming them) to create primary file items and manually update the publication item properties from the XML using either XML suite or Late Night XML tools

Problem:

  • Applescript sucks at processing XML (or I do, not sure which)
  • Too much code, too little time

This seems like the best option, but:

  • I know fuck-all about AppleScript
  • I don't have time to devote to writting a massive script for this

##Ideas for Papersapp

This would make my life a hell of a lot easier:

allow for file:// links/urls present in either the xml or the bib files to be imported along with publication items!

@extracts
Copy link

allow for file:// links/urls present in either the xml or the bib files to be imported along with publication items!

Hi Chris, I agree that this should be possible. I'll try to look into it.

The scripting support unfortunately doesn't currently support to add primary/supplemental files to publications. This is high up on my TODO list.

Do many/all of your PDFs have DOIs? If so, there's an other option to try:

  1. Import the bib or xml file from Sente into Papers.
  2. Close Papers, find the Papers library in Finder, control/right-click on it and choose the "Show Package Contents" command" to open the library package as a folder in Finder.
  3. Now create a subfolder (e.g., called "Files") and copy all your PDF files into that folder.
  4. Now, re-open Papers and choose "Help > Troubleshooting > Repair File Path Metadata".
  5. Wait until your mouse cursor is freely available again (i.e., it shouldn't show the spinning wheel anymore).

Now check your articles (with DOI) if Papers did attach any of your PDFs. The Console.app log should contain more info about the success/failure of the process.

Hope this helps, Matthias

@extracts
Copy link

Re. this:

allow for file:// links/urls present in either the xml or the bib files to be imported along with publication items!

Would you be willing to share your XML file with me, as exported by Sente. This will help us to fix the issue with the file:// links/urls not being recognized. Thanks!

Matthias

@cfriedline
Copy link
Author

Would you be willing to share your XML file with me, as exported by Sente.

Matthias - not a problem on sharing. To where should I send it?

@cfriedline
Copy link
Author

Do many/all of your PDFs have DOIs? If so, there's an other option to try:

I got about 50% (700/1400) this way. Not bad, but still not awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment