DEVONthink to Evernote Exporter Applescript

The latest version of the AppleScript can now be found in the Veritrope.com Code Library!

Hope you enjoy!

44 Responses to “DEVONthink to Evernote Exporter Applescript”

  1. Joe May 22, 2009 at 6:01 am #

    Anyway to get this to work in devonthink 1.9?
    Not working with this version..

    • Justin May 22, 2009 at 11:53 am #

      I haven’t tested this out, but you might try changing one line of the script in Script Editor to see if that gets you up and running:

      Open the Script in Script Editor and find the first line under the (* MAIN PROGRAM *) comment;

      Replace the line that says tell application id “com.devon-technologies.thinkpro2” with tell application “DEVONthink Pro”

      Compile and save the script

      Let me know if that works for you — if it does, I may include that in the next revision of the script (assuming that it doesn’t break anything in 2.0!)

      Kind Regards,

      Justin

      • Joe May 22, 2009 at 9:19 pm #

        Justin, thanks for the tip. I however solved it just by upgrading. Now that my stuff is out of Devonthink, i am fully into evernote.
        Actually, i only had devonthink personal, and i dont think the personal version has script support.

  2. Scott September 10, 2009 at 10:27 am #

    Is the link to the DevonThink –> Evernote utility still active? I could download other scripts but not thie one.

    Thx,

    Scott

    • Justin September 10, 2009 at 10:46 am #

      Hi Scott,

      Thanks for letting me know about the problem with the link!

      It should be fixed — hope you enjoy the script and let me know how you like it (and the others).

      -Justin

      • Scott September 10, 2009 at 10:54 am #

        Thx Justin – all fixed!

        These scripts are great, btw – thx for everything!

  3. Robyn September 18, 2009 at 6:47 pm #

    I wanted to try the change that Justin mentioned above to use this script with my copy of DEVONthink Pro 1.5.4, but I can’t get into the script (it’s run only) to make the change. And I tried pasting the code above directly into AppleScript Editor, but I got syntax errors.

    Help! I really want this to work, but I am just clueless. Thanks!

    • Justin September 18, 2009 at 7:16 pm #

      Robyn,

      I quickly compiled a version for you to try — download link is under the original link.

      You’re going to have to be my “guinea pig” on this one, as I don’t have DEVONthink 1.x anymore…. try it out and let me know your results!

      • Robyn September 19, 2009 at 7:07 pm #

        Hi Justin,

        Thanks for the fast response. I think it almost worked, but then I got the following dialogue box:

        “Item failed to import: -1728 DEVONthink Pro got an error: Can’t get of content id 24143 of database 1.”

        I guess I could upgrade to the DEVONthink 2.0 beta, but I am unsure whether I want to ultimately pay for the upgrade, hence the migration to Evernote — or at least that was my thinking…

        I look forward to hearing back from you, and again thanks for the fast turnaround — awesome!!! 🙂

        • Robyn September 20, 2009 at 3:42 pm #

          Also, does the script need to notate that one is using DEVONthink Pro vs DEVONthink Personal? That just popped in my head as well as I downloaded the Pro 2.0 beta…thanks!

          • Justin September 20, 2009 at 10:43 pm #

            HI Robyn,

            Happy to (try to) help!

            The script assumes that you’re running DEVONthink Pro as the Personal Edition is not fully supported for AppleScripting.

            Not sure why you’re receiving that error message and, since I don’t have DEVONthink 1.x on my system anymore, it’s not really possible for me to test. Can you tell me what kind of note you were trying to export? (i.e., a PDF, a text file, etc.).

            Since you’ve probably already downloaded and installed the DEVONthink beta by now, why don’t you use the original DEVONthink 2 to Evernote script to export into Evernote while you evaluate the new version? I believe that DEVONthink leaves the original version 1.x database intact when it converts it to the 2.0 compatible version — although, if you haven’t upgraded yet, you should probably back it up just in case my memory is incorrect! 😉

  4. Robyn September 21, 2009 at 8:46 pm #

    Yes, it does work with the beta, which is pretty cool in and of itself 🙂

    Thanks again!

  5. vanderleun October 15, 2009 at 5:17 pm #

    “Source code and down­load link on the next page!”

    The next page? Where is the next page? I can’t see any hint and the text above is not a link. Please clarify.

    Thank you

  6. vanderleun October 15, 2009 at 5:18 pm #

    Never mind. Found it. Thanks.

    • Justin October 15, 2009 at 5:25 pm #

      In case anyone else has the same question:
      Page 2

  7. Lucas January 31, 2010 at 7:33 am #

    Hi Justin,

    thanks for the script, I’ve been using it for a while and it works great for PDF and RTF notes; the problem is that it doesn’t seem to work with HTML notes, I get a Growl notification saying that the export has been successful but the note does not show up in Evernote. Is it a known limitation? thanks for your help. Lucas.

    • Justin January 31, 2010 at 1:39 pm #

      Lucas,

      It was a bug…. (I can’t believe that no one else reported this one!)

      Should be fixed in version 1.2 of the script — please download it and let me know if it works for you.

  8. Lucas January 31, 2010 at 1:55 pm #

    that was quick!, tried it and it works!, one small detail though, if you copy the source directly you have an extra “(*” in line 01, and the script won’t compile.
    thanks a lot, this is really helpful.

    • Justin January 31, 2010 at 2:08 pm #

      Source Fixed!

      … and I’m nominating you for “Bug Finder of the Month!”! 😉
      (This is a purely ceremonial honor, sadly.)

  9. MinsikYoon (Minsik Yoon) January 31, 2010 at 8:57 pm #

    Twitter Comment

    To export your DevonThink items to EverNote easily, use this AppleScript! [link to post]

    Posted using Chat Catcher

  10. R Ratcliffe February 25, 2010 at 4:55 am #

    Devonthnk to Evernote not working for me. I get a notification – The variable theTags is not defined. Any way round this, thanks?

    • Justin February 25, 2010 at 10:37 am #

      Ah — the joys of everything not working when a beta goes final.. 😉

      I’ve worked up a quick patch for some tagging-related anomalies that were causing your error (see notes on Page 1). It is Version 1.21 of the script and is now available for download.

      Next stop — getting in touch with DEVON to let them know about it!

  11. R Ratcliffe February 25, 2010 at 11:21 am #

    Justin. Huge thanks and respect. Using the new (final) release of DEVONthink Pro Office 2.0 and the latest version of Evernote for Mac I can now send documents both ways. The two coolest notetaking/archiving applications are now officially talking to each other. Excellent work!

    • Justin March 3, 2010 at 11:10 am #

      FYI — Christian Grunenberg at DEVONtechnologies provided some code that will restore full tagging support, and I’ve updated the script to version 1.22 to incorporate his suggestion.

      For any other DEVONthink scripters out there having tag-related problems, he also says the following:

      The next release will fix [the tags] and the tags property will return an empty list/array instead of missing/undefined values in case of no tags.

      Let me know how it works for you!

  12. Mark March 8, 2010 at 10:05 pm #

    You are my hero. I’ve been trying to find a way to transport over 20,000 files from DevonThink Pro 2.0 to EverNote and had almost given up. My only problem, however, is that I have a lot of formatted text (italics, colored fonts, etc) that are now gone. Is there any way to move the files and keep all formatting intact?

    Thanks!

    • Justin March 8, 2010 at 10:33 pm #

      Hi Mark,

      Glad that the script was helpful!

      I am actually looking at ways of doing just that (Some of it is a function of how Evernote processes the text, however…).

      If it’s possible, I’ll make it happen!

      • Mark March 8, 2010 at 10:42 pm #

        That’s great, Justin. I look forward to your updates. Thanks again for your help!

        • Mark April 2, 2010 at 12:12 pm #

          Justin,

          I know you’re looking into ways of making the formatting work out, but if I were to hire you to write me a script to do just that, how much would it cost? I’m to the point that I would pay someone for a script that would make it possible to copy my DevonThink notes over to Evernote, but I want ALL formatting to be identical. I actually love both DevonThink Pro and Evernote, I just want to be able to have my notes on both programs and have them look the same. Is this something you would consider doing for me?

          Thanks,

          Mark

          • Justin April 2, 2010 at 2:10 pm #

            **I DO** create custom AppleScripts and workflows for my clients and would be happy to tailor any script to you and to how you work! You can read the short description of how that works and get in touch so we can coordinate the details. 😀

  13. Claudio December 23, 2010 at 7:43 pm #

    Hi.I’ve using Devonthink pro for about one month yet and I was looking around for evernote too in the cloud.
    Thanks a lot for your sripts,very helpfull!

  14. Tellef January 6, 2011 at 3:48 am #

    Would it be possible to transfer also the ‘created date’ from Devon>Think notes til evernote?

    • Justin Lancy January 6, 2011 at 6:31 pm #

      Thanks for this suggestion — I am going to add it to my list of things to look at for an upcoming revision of this script!

  15. Justin Burt July 21, 2011 at 5:12 pm #

    This script no longer works, it just freezes after specifying the accepting new book and Evernote. anybody else getting this hang?

    • Justin Burt July 21, 2011 at 5:15 pm #

      Should mention this is after upgrading to LION

    • Justin Lancy July 21, 2011 at 5:29 pm #

      You anticipated my first question nicely, Justin! 😉

      Second question: Have you also upgraded DEVONthink Pro to version 2.2? (I just successfully ran the script using OS X 10.7 / DEVONthink Pro 2.2 / Evernote 2.2.3 )

      • Justin Burt July 21, 2011 at 8:20 pm #

        I indeed have the latest copies of both of these software titles. The import seems to be working now with a different set of files. Not sure what the issue was. Sorry for the stir 😉

  16. Jonathan October 16, 2011 at 6:18 am #

    Hi, I ran into some trouble with the script in two places, going from DevonThink 1.5.4 to Evernote 3.0.2.

    1. I haven’t used tags, and for some reason that was giving me an error, so I commented out the “if exists tags of this_item then” block and just left in the “set theTags to defaultTag” line.

    2. When loading raw text into DT, I often used scripts and sometimes the entering script would set the name of the DT item to be the entire entered text. If the name is too long, the export to Evernote script causes Evernote to crash because it sets the Evernote title to the DT name and it’s too long. I didn’t do an exhaustive test, I found that 195 characters was safe, and that seemed like plenty enough for me. So I added the following code right after the line “set thename to (the name of this_item)”:

    if length of thename > 195 then
        set thename to texts 1 thru 195 of thename
    end if
    • Justin Lancy October 16, 2011 at 8:33 pm #

      Hi Jonathan,

      You’re running an older version of DEVONthink Pro, which would explain the tag error.

      The title code addition is a great idea and I’ll add it in to the next build! Thanks for pitching in and helping to improve the AppleScript.

  17. Matthias Nott August 30, 2013 at 12:59 pm #

    Hi,

    you’re referring to a zero byte error on your page in conjunction w/ DT Pro. I’m getting zeroed files when moving into DT database. Seems to be not a hard disk corruption issue though.

    What did you see?

    M