Mekentosj Papers2 to DEVONthink (notes + PDF indexing)

I originally gave a link to this script in response to another thread, but the title of that thread may well give a misleading impression of what the script does.

As of version 0.022:

For each exported reference in Papers2:

  1. A DT folder is created, named after the reference.
  2. Inside the folder, a record is created which indexes and displays any PDF attached to the Papers2 reference.
  3. Each Papers2 note is exported to its own record in the folder.
  4. Any summary/abstract for the reference in Papers2 is exported to its own record.

Multiple Papers2 Notes

Papers2 offers only one (large and unsegmented) note field, but the script now treats any
line terminated by a colon:
as the header of a new note. Everything that follows, until any further colon-terminated line, is treated as the body of that note.

This allows for simple segmentation, by the user, of their notes in Papers2.

(Shorter note records can allow more focused or better-targeted use of DT’s search and See Also functions. There is a non-technical discussion of this point in Steven Berlin Johnson’s 2005 article).

(Thanks to Bill DeVille for useful comments which prompted the indexing of PDFs and the option of segmenting notes).

Ver. 028 adds hyperlinks from the DEVONthink 2 records and groups back to the corresponding bibliographic record in Mekentosj Papers2.

HI Rob

Thanks for the script. FYI, with Papers2.2.5 and DTPro Office 2.3.3, the script does two odd things when importing summaries (no notes yet in the pdfs I’ve been playing with today.

  1. Citekey is author and year only - the two letters at the end of the cite key appear to be stripped off.
  2. Indexing to original pdf does not take place.

Any ideas?

Thanks again


After shutting DT and Papers2 down and relaunching, cite key now behaving correctly, but indexed version of pdf not imported…

Hi houthakker,

Thank you for writing this script and making it available (even after the end of mobileme). I’ve been checking out the trial version of DT to see if it will enhance my current workflow (which is essentially for linking and organizing ideas captured via notes and annotations in Papers2), so the script is much appreciated!

I have a question about using the script. I’ve successfully installed the script (I am new to scripts so this was actually a step), but it’s not working and I think it’s because it cannot find my Papers2 library. The dialogue window shows that there are 0 items in “all references”. I opened up the script in Applescript editor to try and take a look and it seems that the script looks in the default location for my Papers2 library. I moved my Papers2 library from the default to my Dropbox so that I could sync it across devices. So, this seems to confirm that the location of my library is the issue.

I tried to just change the path name to my library’s current location, pointing to just the “Papers2” folder, but this just results in errors. I’m too unfamiliar with scripts to know whether this is the correct or only change I need to make to the syntax of the script. If possible, I was hoping that you, or someone else more knowledgeable on this forum, would be able to explain to me how to modify the script so that it points to a non-default location of the Papers2 library.

I would very much appreciate any advice or information someone might have. Unfortunately, I don’t have the time to teach myself this area to myself - at least right now. It seems I’m missing out on a lot of functionality so I might study it in the future.

Thank you for your time,


As a suggestion, given you are evaluating all this on a trial basis at this point, why not move the Papers2 folder back to the default location for evaluation purposes?

I suppose I could but I think the trial would be artificial. I’d like DT to fit into my current workflow. If I find out that I like DT, then I would still have to deal with this issue, plus move everything and restart DT (since I assume that DT databases are linked to file’s location).

But that’s a good point - it wouldn’t be much work, retrospectively, if I end up not liking DT. I’ll do it if I can’t figure out the answer soon.


Solution: You can simply change the file path in the script to wherever the true location of your Papers2 library is. You just have to make sure that spaces in file names are written as "\ " (bslash, bslash, space) rather than just a space. The script is written in such a way that it will be easy for you to find the right spot to change the path.

Also, this script can be installed by placing it in an appropriate category, e.g. import, in “~Library/Application Support/DevonThink/Scripts”.

You can use the script, by selecting the script menu in DT, navigating to the appropriate category, and finding the script name that you just installed. The script will ask you if you want to import notes from all references in your Papers2 library or it gives you a number of options to find specific papers to import from.

Just thought I would post this in case others might find it useful. It’s ridiculously simply in hindsight. Thank you houthakker!!

After using the script, I’ve found out the following.

Two files (without using the colon trick) are imported into DT: Notes and Summary. Notes are the overall notes for the article, not sticky notes. Summary is the abstract information from the metadata of the article.

Highlights and sticky notes are not imported, but sorely needed in my case. Does anyone know of a way to include highlights and sticky notes from Papers2 articles?

I know that Papers2 can export these items as a single text file. Is there any way that DT can be ‘trained’ to parse out individual chunks of text from a large file? Or any other way to automate the process of exporting sticky notes and highlights from Papers2 to DT?


I’m continuing to use the combination of Papers2 & DT. Now that I am moving from reading /data collection to the writing phase of my Masters dissertation, I’m glad I have done so.

I’m glad you’ve worked out how to tell the script where your papers library is!

Since Houthakker very kindly wrote the script, Mekentosj seem to have reworked their library database structure, so more manual steps are now required to get notes & highlights into DT than used to be the case. I’m afraid I don’t have the skills to revise the script… The good news is that the Papers2 notes feature is now way better than it was 12 months ago.

My workflow is as follows:

  1. Find / download / highlight / annotate journal article in Papers2
  2. Decide where / how I want to file the extracts in DT
  3. Run the script.
  4. Tag folder/group as necessary.
  5. Check that citekey has been imported correctly (they sometimes come out as {foobar2002} rather than {foobar:2002az})
  6. Export notes from Papers2 as plain text file
  7. Import to DT
  8. Open file in DT editor
  9. Convert to Rich Text to enable use of bold / italics etc
  10. Copy / paste citekey below journal title.
  11. Clean up content of file as required. I get rid of the “-- highlighted 8 aug 2012” strings and excess page numbers using find and replace.

Now that I am writing, I am reaping the reward of all my earlier clerical efforts, as DT’s ability to search my notes makes for much better results than using Papers2’s search feature.

Also, where OCR has not been run on a journal article, or the result is so bad that highlights turn into garbage notes, it is really easy to use the DT Office Pro OCR feature to sort out the problem.

FWIW, I have asked Mekentosj to implement the following enhancement to the exporting of highlights / notes:


The more of us who ask for it, the more likely they are to implement it… :smiley:

Hope this helps.


Hi Vincent,

Thanks for your reply! It was very interesting. I have always done my reading and notes offline - meaning that I print them out and physically highlight. This really didn’t work well when preparing for my thesis proposal defense. For example, if I wanted to review “social identity theory” then I would pretty much have to skim a huge stack of articles and search for notes in the margins. It was so time-consuming as to be completely useless.

Since upping to Papers2, with their improved annotations, I have been making the switch to annotating digitally. But, it still didn’t solve the problem of synthesizing the information and making links between them (useful in defense prep and writing stages). I just came across DT and I think it’s what I’m looking for so I would super appreciate your advice in getting started in moving my research into it. For example, did you index your Papers2 database? Or are you just OCR’ing individual problem papers? I’m afraid that I literally just started so I don’t even know the right questions to ask but it would be great to get the perspective of another student!

I think the idea of tagging small chunks of information is perfect! That way I can search for “social identity theory” or “specific citation” or even “ref’s to look up” (to see ref’s that I’ve highlighted in all articles). Your method sounds great and exactly what I’m looking for but with two exceptions. First, I’d like to use the Steven Berlin Johnson method of small chunks. Thus, adding notes manually to DT would be pretty time-consuming as there are probably around 20-30 notes and highlights per article. So, second, I would like to try and find some way to automate this process.

The need is so great that I wish I had the time to learn how to fix the script. It took me ages to solve the simple space issue (unfortunately) and I need to spend time preparing and writing my thesis rather than continuing to research the apps to get there. Maybe I could try to ask the Mekentosj team to allow for the option to export each individual note and highlight separately? Or perhaps there exists a text parsing app or function that I am unaware of? I hope others on this forum can comment on their workflows or offer advice.

BTW, I totally agree that the “when” information for highlights is completely useless. I’ve already contacted the Mekentosj team to suggest changing that to citation information!

Thanks again,


I suggest we kick ideas around off-list. Not sure which time zone you are in - I’m in the UK. In the meantime…

This is exactly the model I’m following. for my MSc dissertation - 10k word target, literature / theory synthesis - i.e. no original field research. I’ve got about 130 papers in my DT database. A single Papers2 article export can have 20-70 highlights in it, including references - but it’s only a single .txt file once you’ve exported it.

if your Papers2 notes export file is too big, you can split it in DT so you end up with discrete chunks which are on the same subject - just right-click at the point where you want to split it and select the "split document option near the bottom of the list. The only ‘gotcha’ is that you then need to fish the split file out of your database inbox and put it back where you need it…

I’ve in fact found that the process of tidying up a set of imported notes is a valuable process which makes me think about the content / argument etc.

In terms of DB structure, you’ll get as many opinions as respondents - I prefer nested groups / folders, and only use tags as a secondary tool. DT’s “replicants” feature means that if you want to have a given paper filed under, for example “economic antecedents” as well as “philosophical antecedents”, you can have the same group (aka folder) show up in both places.

The really cool bit is when you have a vague recollection of some key word or connect, but you cannot remember where on earth it was. that’s where DT’s AI saves the day (especially if you can use more than a single word in your query).

Hey all,

As has been discussed in this thread, the ability to import highlights would be incredibly useful. I don’t have the scripting knowledge to amend the original script. Has anyone tinkered with it, and would you be willing to share?

Many thanks,

Hi there, I’m sorry to revive this without making a contribution, but I just started using DT Office Pro, and was really hoping to try this script, but I can’t find it anywhere.
Does anyone happen to know where I might still download it?

Edited to remove a link which is no longer relevant

I’m sorry, but I looked there and I don’t see any scripts pertaining to the Papers application.

Hi Squareshot :blush: :blush: More haste less speed…

I think Houthakker settled on Sente rather than Papers, and he may have removed a script whose last revision was July 2011. I hope I will be forgiven for attaching the script (assuming that zip files can be attached to posts…)

Your mileage may vary, and for the benefit of anybody else stumbling on this thread, you will need to adapt the workflow I outlined earlier in this thread to your own needs.

Hope this helps (97.3 KB)

VincentA, thanks for the explanation and the script- much appreciated!