Evernote to DEVONthink Export Applescript

Have a Mac and want to export your Evernote items into DEVONthink? Using AppleScript makes it easy!

***

Source code now in the Veritrope.com Code Library — Click Here To Get It!!

***

I’ve designed a script that:

  • Utilizes Evernote’s HTML Export to copy the exported HTML file (and its constituent elements) to a temporary folder on your Desktop
  • Detects and Imports the Note as a PDF if the source note contained a PDF, or…
  • Bundles everything up from other types of notes into a single Web archive file and then imports it into DEVONthink, and
  • Throws the temporary files in the trash for you

Features

  • The script has been substantially rewritten since the release of Evernote’s native HTML Export function, eliminating the need for a separate webarchiver program and also improving the performance of transferring notes with typographical symbols in their title!
  • The revised script also does a better job of importing PDFs
  • The script will also retrieve an alphabetized list of your current DEVONthink groups and allow you to select which one to archive your messages into.
  • Want to make a new group? No problem — the script now uses DEVON’s own “Group Selector” interface which will let you do that on the fly!
    DTP Group
  • **UPDATED** The script now brings over more of the data from Evernote — Version 1.3 changes the “Creation” and “Last Modified” dates to match the original item in Evernote. Tag transfer is also now supported — but must be enabled manually (see below).
  • Automatic Growl detection has also been enabled which will save you a trip to the Script Editor to enable/disable it.
  • dt-growl

Tagging

I have added the ability to transfer tags from your Evernote items into the new DEVONthink items but, for this version at least, YOU HAVE TO ENABLE IT MANUALLY!

Change This Value To Enable Tagging -- But Be Careful!

The reason I’ve chosen to do it this way is because, simply put, DEVONthink treats tags like they are groups. If you bring over a bunch of notes from Evernote with lots of different tags, your group list is going to be populated with them as well. To me, this is counter-intuitive enough to where I feel the need to leave it “shut off” — but allow you to turn it on if that’s what you prefer. If you do decide to try it, I’d suggest that you start with a few notes and examine the results in DEVONthink to see if you like it.

To enable transfer of tags, you just need open up the script in your favorite editor and change the value of the first property (called transferTags) to “ON”.

Other Notes

  • The file names are sometimes altered in the exported version if they include typographical characters that would halt the file creation process;
  • Attachments may not save with the new note
  • You should always proceed cautiously at first to understand how the script works before moving large amounts of your files around. I use this script myself and feel very comfortable with using it, but I cannot accept any responsibility for any data misadventure you might suffer. Use at your own risk!

***

Please “Support The Cause” With Your Donations, Comments, And Retweets!


93 Responses to “Evernote to DEVONthink Export Applescript”

  1. Keith May 24, 2009 at 7:34 pm #

    I was very pleased to find your Evernote to DEVONthink script as most of my notes have embedded images and the script supplied with DEVONthink works with text only. Your script worked fine on the first two or three trials, but now I get an error message “Item Failed to Import: -48 The operation could not be completed because there is already an item with that name”. I have tried shutting down and restarting but still get the error. Any help would be greatly appreciated. Thanks

    • Justin May 24, 2009 at 7:48 pm #

      Hi Keith,

      Let’s try to isolate where the import is going astray:

      1.) Are you, in fact, importing a note with the same name as an existing note into DEVONthink? If so, why not alter the title of the note in Evernote subtly and try again!

      2.) If you don’t already have a note with the same name in the DEVONthink Group, try creating a new group in DEVONthink and then trying the import again.

      Please let me know if either resolves your issue. If neither does, please let me know as well — we’ll take some additional steps at that point to hone in on the problem.

      Kind Regards,
      Justin

      • Keith May 25, 2009 at 7:13 am #

        Hi Justin
        Thanks for the reply – I tracked down the problem to the fact that the temporary file created by the script on the Desktop had not been deleted for some reason. After deleting this by hand everything works fine again.
        On a different matter – is it possible to have the script run in background? I have a LOT of Evernote notes to copy and the focus keeps shifting back to DP2. Not a showstopper but it would be nice to be able to get on with other work while the script is running.
        Many thanks

        • Justin May 25, 2009 at 1:38 pm #

          I’ll put it on the list for the next revision!

          In the interim, please let me know if there’s anything else that you feel might make it more useful.

          Kind Regards,

          Justin

          • Keith May 25, 2009 at 3:43 pm #

            It is working really well, but there are just a couple of issues. The first is probably a user issue to resolve. Some of my Evernote notes have identical titles (like ‘screenshot’ that I didn’t bother to change when creating the note). The script crashes when it finds these, as it can’t create a folder/file with a duplicate name. The second issue is that occasionally I created or added to a note in Evernote by dragging in a pdf. The script can’t cope with this and so DT2 just displays an icon instead. Unfortunately Evernote doesn’t seem to provide any way of identifying these in advance of running the script, which means having to go through each one in DT2 after the import.
            Best regards, Keith

  2. Justin May 25, 2009 at 6:06 pm #

    I’ll see if I can improve how the script handles duplicate file names (and, in the case of your original issue, a pre-existing folder). Any AppleScripters out there with some suggestions / code examples?

    • Keith June 13, 2009 at 6:28 pm #

      The new version works great with embedded pdfs in Evernote. Notes with duplicate titles in Evernote still cause a problem though – two notes duly appear in DEVONthink after the import, but their content is identical. There is a second problem which took a while to track down: most of my notes have embedded images, and in quite a few cases the original image from EN was replaced by an unrelated ‘rogue’ image after import into DT, the rogue image being the same in each case. The text view of these notes in DT shows that the images had all been imported with the identical name screenshot.png. Presumably this was the name given to the images in EN when the notes were created. While the identical images names don’t appear to be a problem for EN, what seems to be happening in DT is that the image displayed in the imported note is whatever happens to be called screenshot.png in the DT database. Hence the appearance of the same rogue image.
      Best regards, Keith

      • Justin June 14, 2009 at 6:55 pm #

        The “rogue image issue” is an odd one!

        I am going to try to recreate it here but, in the interim, could you take a look at the notes in Evernote that you’re seeing this issue with to see if, in fact, they all have images with the same file names?

        I will also tackle the “duplicate items” issue for the next revision and will report progress as (hopefully) I make some. 😉

        Thanks for your excellent, detailed reports Keith — they’re really helpful!

        • Keith June 17, 2009 at 4:54 pm #

          I have checked my EN notes that have embedded images. The format for the name given to the images has varied over time, and probably depended on which version of the Sarafi or Firefox clipper I was using. The most recent version of the Safari clipper seems to give each clipped image the same name of ‘screenshot.png’, whereas in the past more meaningful (and unique names) were given, usually based on the title of the webpage being clipped.

        • Keith June 17, 2009 at 6:03 pm #

          …it is interesting to look at the temporary file created on the desktop (by commenting out the delete command in your script). Applying Webarchive Extractor to a typical .webarchive file, then the image file is extracted to the same folder as the index.html file; within the webarchive it is referenced as file:///screenshot.png and retains this reference when imported to DT Pro. I think this is why DT Pro then displays identical images. In contrast, the html file created by the script puts the image file in a resources sub-folder that has the name of the note (test_note, say). So if I then view that html file in a browser, the reference to the image is now test_note/screenshot.png. This reference is retained in making a webarchive from the browser page to DT Pro, and everything is fine since the reference to each image includes the name of the note e.g. test_note/screenshot.png.
          I don’t know if this helps!

          • Justin June 18, 2009 at 11:29 pm #

            After playing around with the script (and replicating your “notes with images of the same filename” scenario), I am beginning to think that this may be a Webkit/Safari issue.

            If you comment out the “delete temp file subroutine” of the script as you did, you’ll have all the raw components of the Webarchive…and also the Webarchive itself. Double-clicking a Webarchive file opens it up in Safari and, as you’ve probably already discovered, Safari renders the web page with the same image in each of the Webarchives if the filenames for the images are the same. This is, of course, the same thing that happens in DT2… (but now we’re reproducing the error outside of DT2!)

            When I decompiled the Webarchive files, I was surprised to discover that the correct image files were saved inside each archive. Frankly, I was expecting that the Archiver had bundled the wrong image over and over.

            So what are we left with? I have a theory, but I need to learn more about how Webkit handles Webarchives to sort it out. Sorry it’s not a quick fix, but I will do my best to get to the bottom of it and update the script when I do!

            Anyone else have thoughts on this?

  3. Janieangus October 17, 2009 at 6:25 am #

    Justin, the new EV to DT script isn’t working for me, the one where you added DT’s group choice dialog. I keep getting the message:

    Import Failure
    Filed to export due to the following error:
    Can’t get item 1 of {}

    I tried this with an entire EV folder, and a single file from that EV folder.

    • Justin October 17, 2009 at 7:51 am #

      Hi Janie,

      Can you help me zero in on the problem by doing a couple of things to troubleshoot?

      If so, I’ll have you start by emptying the Trash *inside Evernote* before retrying the export. If that fixes things for you, then it is an issue that I need to raise with the Evernote development team!

      If not, can you tell me more about the notes being exported. What type of files? Attachments? Any typography in the title of the note?

      Hope you are well (and that this fixes the problem),
      Justin

      • Janieangus October 19, 2009 at 4:45 am #

        Justin,

        I did all you said.

        (1) Emptied trash in both EV and DT and tried. No luck. Same error message.
        (2) Upgraded to latest EV, and rebooted. Tried again. Same result.
        (3) Removed all typography. Tried again. Same result.
        (4) Files are all clips using the control-command-v thing, or PDF, ranging from 169 bytes to 1.9 MB (just one of those.) Most under 750 KB. I dont know how to do an attachment in EV; I just select and save.

        Oh, yeah, and I regularly ditched the temp folder on the desktop.

        Then you announced 1.21. So I installed that.
        Decided to try just one file. Worked like a charm. Tired to do a folder that I got this message.

        Import Failure
        Filed to export <> due to the following error:
        Can’t get item 1 of {}

        Over and over and over again. Removed the one file I exported to DT. Threw out the trash. Ditched the temp folder. Rebooted. Same error message again about the same single file.

        Do you still have ver 1.1 around? It worked for me.

        Thanks,
        Janie

      • Janieangus October 19, 2009 at 4:47 am #

        Whoops! What should be between the carats is: THE NAME OF THE SINGLE FILE I EXPORTD

        • Justin October 19, 2009 at 10:01 am #

          If I could give you a prize for thoroughness, I would! 😉

          In lieu of that, here is a link to version 1.1 while this issue is being sorted out.

          I’ll also try to recreate the issue here as best as I can so we can solve the larger issue and, to that end, I’ll send you an email later today with a few more questions.

          • Ben February 5, 2011 at 11:32 pm #

            Did this ever get fixed? I’m getting the same error.

          • Justin Lancy February 8, 2011 at 2:24 pm #

            Hi Ben,

            I am about to do a private beta of the new Evernote-to-DEVONthink script… If you want an early look at it, just follow the Twitter feed for an announcement!

  4. Ralph Elliott October 18, 2009 at 4:03 pm #

    First off thanks for this script.
    At first when I ran it AppleScript complained that the variable isRunning was not set.
    I searched the script and could not find any place where the variable was initialized to “false” so I added the line
    “set isRunning to false”
    right after the comment
    “Check for GROWL”.
    Then it worked just fine.

    • Justin October 18, 2009 at 4:21 pm #

      Hi Ralph,

      Thanks for “rolling up your sleeves” and both finding and sharing your fix!

      I must have inadvertently deleted isRunning from the Property list… I will add your fix to the compiled script and it will appear in version 1.21 which, for anyone that is interested, should be posted later today.

      Version 1.21 should also have a fix for items in your Trash appearing in your export list and occasionally causing the aformentioned “Can’t get item 1 of {}” error.

      Keep those bug reports and suggestions coming!

  5. Justin October 19, 2009 at 8:54 pm #

    Janie — I know you said that your notes didn’t have any typography in their titles, but feel free to try version 1.22 of the script to see if it resolves your issue!

  6. Breggol October 23, 2009 at 2:42 am #

    Evernote has an export menu and the DEVONthink 2.0 beta 7 has an Import > Evernote script available by default. Why would we need your script? Does it have more enhanced functionality?

    • Justin October 23, 2009 at 12:35 pm #

      Away from my DEVONthink workstation, but I’m wondering if it’s the script that was posted at the DT forum awhile ago and (I think) was included from Beta 4 onwards.

      If it’s the script I’m thinking of, it was designed to import ENEX files already exported from Evernote. My script differs from that by allowing you to do the transfer entirely within the script and it utilizes Evernote’s HTML export. Also, when DT turns on tagging, a simple modification should bring those into DT as well.

      Like many things tech, there’s usually more than one road that leads to the same place; try both and see which you prefer!

    • Justin October 27, 2009 at 2:30 pm #

      Follow-Up:
      Here’s DEVON’s own write-up on the subject!

  7. Justin November 6, 2009 at 1:34 am #

    YOU ROCK!!

    • Justin November 6, 2009 at 6:06 pm #

      Glad you liked it! 😀

  8. Jaime November 10, 2009 at 3:22 am #

    Evernote to Devonthink Script. I have tried your script a few times and I got different results. While importing a pdf file from EN everything went ok. While importing a note made directly in EN although Growl report success and there is a sound nothing appears on the destination folder of DT. I have no knowledge of scripting so I can not be of help to you but none the less I curious about the difference in behaviour of the script. If you need more info about this please contact me.

    • Justin November 10, 2009 at 4:03 am #

      Hi Jaime,

      Let’s start with a few basics:
      1.) Which versions of Evernote, DEVONthink Pro , and Mac OS X are you running?
      2.) Does this affect every note made directly in Evernote or only some?
      3.) Any non-alphanumeric characters in the titles of the notes that fail?

      • Sander Datema January 6, 2010 at 4:29 pm #

        It seems the latest version of DTPO (beta 8 ) is ruining things.
        The Evernote2DT script will time-out on the part where the script wants to show a group select dialog for DT.

        • Justin January 6, 2010 at 6:06 pm #

          Hi Sander,

          I’ve duplicated the problem here and I will contact DEVON right away to make them aware of the issue!

          In the meantime, I’ll see about coming up with an alternate “group selector module” for the script. My recollection is that this is possible and I’ll move forward with it if it looks like a bugfix is not in our near future.

          • Justin January 6, 2010 at 10:11 pm #

            A follow-up — I posted the issue on the DEVON forum and received the following reply:

            This is a known and annoying bug and fixed for the next release.
            Annard Brouwer
            DEVONtechnologies, LLC

            Hopefully, that’ll be soon! 😀

  9. joepie January 11, 2010 at 5:50 am #

    I’ve been using Evernote for a while, but I regret that now, since EVERNOTE REFUSES TO GIVE MY DATA BACK (e.g. no serious export function) and EVERNOTE EATS MY DATA (large pdf’s are truncated without warning).

    Your script seems to be the solution to liberate my data out of this Evernote hell. Thanks for your effort.

    Unfortunately it doesn’t work yet:

    “Import Failure – Failed to export TRACK4 due to the folowwing error: DEVONthink Pro got an error: AppleEvent timed out.”

    What goes wrong? Do you got a solution for this?

    Thanks in advance!!!

    • Justin January 11, 2010 at 11:13 am #

      I am going to assume that you are using DEVONthink Pro 2 Beta 8 which, if you read the comment thread above, seems to have a known issue that causes a time out with the script.

      DEVON says that this bug will be fixed in the next release. If it isn’t, I’ll rework the script to try to avoid the bug.

      In either event, keep checking back here and I’ll have an update for you — either way!

  10. R Ratcliffe January 24, 2010 at 5:37 am #

    Downloaded your Everynote to DEVONthink script and it crashes DT every time I try to import an Evernote document.

    • Justin January 24, 2010 at 1:28 pm #

      Hi Roger,

      I am assuming that you might be using DEVONthink Pro 2, Beta 8. If so, my guess is that you are experiencing the same bug as other people in the comment thread (see above).

      DEVON promises that the bug will be fixed in the next release, although I haven’t heard a timeline for that yet. Check back here and I’ll update you all as I hear any news!

  11. Justin February 24, 2010 at 2:08 pm #

    AN UPDATE:
    DEVONthink 2 was released today and, in its final release form, seems to have fixed the bug!!!!

    Anyone who had difficulty with the script should download the new version of DEVONthink Pro and try again.

  12. Fred March 1, 2010 at 5:41 pm #

    Justin,

    I’m having two issues with this script that I can’t sort out (due to my lack of OSX and AppleScript skills – no doubt):

    My software:

    Mac OS X – Version 10.6.2
    DEVONthink Professional Office 2.0.1
    Evernote 1.6.1
    Evernote to DEVONthink Exporter – Version 1.22

    The issues:

    1. Importing Evernote notes with quotation marks in their titles fails with this error:

    Import Failure
    Failed to export due to the following error:
    Can’t get item 1 of {}.

    The title of the note that I was trying to import for this example is: This is a “TEST”

    When I remove the quotes it imports fine.

    2. The script doesn’t work when run from within DEVONthink, but it works fine when run from the AppleScript Editor.

    When I run the script from DEVONthink Pro Office (menu) -> {Scripts icon} -> Import -> Evernote to DEVONthink 1.22 it looks like it is running; that is all the prompts work and Evernote bounces ever time a note gets processed; but no documents show up in DEVONthink. They made it out of Evernote because I found them in my Trash; but DT never imports them.

    However – and I find this truly odd – if I run the script from within the AppleScript Editor – it works flawlessly!

    Please clue me in. Am I doing something wrong, or have I found some bugs?

    Thanks!

    -Fred.

    • Fred March 30, 2010 at 10:53 am #

      Just a quick update to my 3/1/2010 comment. I get the same results with this software:

      Mac OS X – Version 10.6.3 (was 10.6.2)
      DEVONthink Professional Office 2.0.2 (was 2.0.1)
      Evernote 1.7.2 (was 1.6.1)
      Evernote to DEVONthink Exporter – Version 1.22 (same version)

      Thanks!

      -Fred.

      • Justin March 30, 2010 at 11:34 am #

        Fred,

        Thanks for following up on this — realized that I let our exchange fall through the cracks a bit. My apologies!

        I had been waiting to hear back on the “run from the script menu issue” and, although not an official DEVON response, one user offered some interesting observations:
        http://www.devon-technologies.com/scripts/userforum/viewtopic.php?f=20&t=10333

        Can you reproduce this?

        In the interim, I am posting the Evernote-to-DEVONthink Exporter Version 1.23 — this is an attempt at a work-around for the quotation issue you reported before. Take it for a spin and let me know if it works for you!

  13. Julian April 5, 2010 at 12:43 am #

    Apologies if this is covered elsewhere, but is there any chance this script could pull the url of the Evernote entry’s source website and bring it into Devonthink?

    The script just worked like a charm on 95 html snippets and pdf’s, but the source url is listed as “/index.html” rather than the original, which I often use to see if the material is updated, read the whole article, etc. …

    Thanks for a great script!

    • Justin April 5, 2010 at 1:23 am #

      Hi Julian — good timing!

      I am working on a few changes for the next revision of the script and should be able to include this in the next release.

      Check back soon for the update or subscribe to the Twitter feed to be notified when it’s ready!

  14. joepie April 15, 2010 at 11:41 am #

    Thank’s for all you’re efforts.

    Your script looks pretty and seems a lot faster, but still doesn’t do anything, really.
    Notes never arrive in DEVONthink, they just appear in a folder on the desktop.
    When I select ALL the notes, just ONE note appears in the same folder.
    PDF’s -and even images- are converted to plain text with HTML in it, in the case of images totally unreadable for any editor.

    Still, there seems to be only one solution to get MY DATA out of Evernote: exporting thousands of notes by hand…

    • Justin April 15, 2010 at 12:22 pm #

      Hi Joepie,

      The script is working for most people, so let’s at least take one more shot at make it work for you — so you don’t have to do it all by hand! 😉

      First thing — If you’ve ever had trouble with a previous version of the script exiting on an error, delete the Temporary Folder on your desktop before trying again with the newer script!

      Next — make sure you have deleted the old script and are running the latest version.

      Last — Make sure you’re running the latest versions of DEVONthink Pro and Evernote.

      If the errors continue, then we’ll move on to the next step to put our finger on the issue.

  15. Will June 28, 2010 at 2:37 am #

    I’m having a couple of problems with the script. It runs fine exporting PDFs from evernote into devonthink (they show up as PDFs in devon), but regular text notes come in as webarchives, which I then need to convert in devon into rich/plaintext, which is a tedious extra step. Am I missing something here?
    Second, for some reason the webarchives show up with black text on a black background, and are thus unreadable. Again, there’s a manual get-around (click the Text View/Preview button in devon and manual change background-color to white in the code, but I’m sure something’s just gone wrong somewhere! Any ideas?

    • Justin Lancy June 28, 2010 at 9:31 am #

      The webarchive thing is expected: it was a choice that I made to ensure that everything associated with a note would travel over into DEVONthink Pro. I’m experimenting with some other concepts, so rich/plaintext may be part of a future release…. but no promises! 😉

      I’m guessing that the black text-on-black you’re getting is related to Safari 5. (Is that what you have on your system?) If so, this is a known issue that is waiting on Apple to fix it. Again, some new code I’m working on *may* work-around this problem… but it may be a while before I am able to get it into releasable shape.

      Let me know if I’m right about the Safari issue by submitting a bug report here. This way, it’ll be added to my database of things to fix — and I’ll follow up with you when I have an update!

      • Will June 28, 2010 at 4:50 pm #

        Yes, Safari 5. I’ve submitted a bug report.
        Thanks!

    • OogieM October 8, 2010 at 6:52 pm #

      OK Stupid newbie question, where in Devon is the Text View/Preview button so I can manually fix the imported notes? I’ve looked in the view menu and in styles and played with colors but can’t figure it out.

  16. Don Spady July 23, 2010 at 11:56 am #

    I have been trying the Devnothink to Evernote Export and am not getting any import at all. When I run the applescript, I get a prompt for the Evernote group I want to import, I pick one of them and then a while later there is a box with a listing of all the files, which I choose, and then the script prompts me where to put them. I entered new group, called it Evernote2, and pressed Continue (or next or OK, not sure what). Nothing happened. No confirmatory message or anything. When I looked at Devonthink, there was a group called Evernote2, but there was nothing in it.
    What am I doing wrong?

    Many thanks

    Don Spady

    • Justin Lancy July 23, 2010 at 3:38 pm #

      I’m not really sure… but let’s see if we can get to the bottom of it!

      To confirm, it’s letting you select the notes for export and creating the new group — but the notes aren’t going over?

      Questions:
      1.) What version of Evernote?
      2.) What version of DEVONthink Pro?
      3.) Do the notes have any attachments to them (e.g., PDF files, Images, etc.)?

      • Don Spady July 26, 2010 at 10:09 am #

        Evernote Version 1.5.2 (62233) (for Mac).
        DevonThink Pro 2.0.3 (Latest)
        The notes are virtually all clipped web-pages, very few pdfs, but lots will have images, etc.

        I have just downloaded the latest Evernote and will try it to see if I have any better luck.

        Don

        • Don Spady July 26, 2010 at 10:24 am #

          After downloading and installing the latest Evernote, the results are the same. I get to the stage where it lists the items to be imported, I clic on ‘select-all’, they are all highlighted, I press continue, and select new group, which I create, and then New group seems to be created, but there is nothing in it.

          DOn

  17. Stephen Winnall September 11, 2010 at 5:31 pm #

    This is a really cool idea. I’ve been looking for a way to share stuff between DT and EN for some time.

    I have a problem using EN to DT V1.3 though. Not all my PDFs come across to DT properly. Some do, but others arrive with a black background and a link labelled “.pdf” The uuid appears to be the same that EN uses internally (you see it in the iPhone client, for example). The link points to my temporary folder to a file which no longer exists (presumably the file you create in the script).

    The PDFs that are transferred properly are all marked with the text

    “Producer Mac OS X 10.x.y Quartz PDFContext”

    This appears in the hover text of the title of the PDF in DT. The others (with the .pdf link) do not have this text in their hover text.

    Most of the PDFs I created from Safari using Print > PDF > Save PDF to EN.

    I am running on Mac OS X 10.6.4 (most, but not all, of the PDFs were created under 10.5.8). I’m using DT Pro Office 2.0.3 and EN 1.11.0. Oh, and Safari 5.0.2 for the black background 🙂

    • Stephen Winnall September 11, 2010 at 5:37 pm #

      Something got filtered out of my message above. The links in the PDFs that are incorrectly transferred have the name UUID.pdf, where UUID is something like

      CEF0BA21-F2D0-4E9…. etc.

      I wrote UUID in angle brackets in the original posting, which got filtered out. So the references above to “.pdf” should be references to “UUID.pdf”, where UUID looks like the thing above.

      Steve

      • Justin Lancy September 11, 2010 at 6:00 pm #

        Steve,

        Thanks so much for your kind words — and for your very specific feedback and investigation into this issue!

        The black background aspect sounds like something related to a known 10.6.x issue, but the PDF part is new to me! I am reworking all of my scripts this month and I will try to reproduce this issue on my end while I am updating this script. If I can, then we probably have a fighting chance of working around it.

        While I am, please let me know if you discover any more “clues”. I’ll also probably be directly in touch as I work on the DEVONthink Pro scripts to give you an opportunity to Beta Test the new revision.

  18. Jake September 29, 2010 at 2:42 pm #

    Hi Justin,

    Thanks so much for such an awesome script!

    I am wondering if it might be possible to make the script default straight into my DEVONthink inbox for later sorting–rather than asking me to choose a group every time I depress the global key. Ideally I’d like to have two shortcuts (one with a modifier of the original) that allow me to decide whether or not I want to choose a group at that moment or defer it instantly to the inbox for later review.

    Again, thanks so much for your work.

    ~Jake

    • Justin Lancy September 29, 2010 at 2:58 pm #

      Hi Jake,

      Your timing is excellent! 😀

      I am in the midst of revising almost all of my scripts here and I think what you’re talking about shouldn’t be a problem. Subscribe via RSS or keep an eye on the Twitter feed for the next few weeks and you’ll likely see a “Direct to Inbox” version posted!

  19. OogieM October 8, 2010 at 8:30 pm #

    Ran into a problem, novice here so I have no idea how to fix.

    When I try to import an Evernote Notebook I get the error message “Can’t set <> of missing value to date “Tuesday, September 22,2009 3:23:47 PM”

    This is on the first note in that notebook and nothing happens after that.

    ANy hints for what I need to do to try to get as much in as I can?

    • Neil January 30, 2011 at 9:30 pm #

      I just wanted to chime in here that I’m having the same problem – the very first item errors out. Interestingly, I can get the second item to import, but when I look at it in DTP all I see is a link to a PDF which returns “not found”.

      • Neil January 30, 2011 at 9:37 pm #

        I found what was causing that error – if a note in Evernote has slashes in the title, the export fails.

        For example, the very first item in my export list has the date in the title (Vet 14/05/10). 100% reproducible.

        I’m running DTP office 2.0.6 and Evernote 2.0.1 on Mac OS X 10.6.6.

        • Justin Lancy January 31, 2011 at 1:42 pm #

          Hi Neil,

          I already have a fix in the pipeline for that — as well as a few things that I’m going to roll into a “2.0 Version” of the AppleScript!

          If you have any other suggestions, tweaks, or if you’re interested in testing a Beta, just let me know and I’ll send you a copy when it’s ready… And of course, the Twitter feed will shout it from the rooftops when it’s released to the wider world.

          • Neil February 1, 2011 at 10:27 am #

            Awesome! I’d be happy to give this a whirl once you’ve got a beta version ready for testing. Thanks!

  20. OogieM October 17, 2010 at 11:48 am #

    Is there any way to edit this so that it creates plain text versions in Devon Think instead of web archives?

    • Justin Lancy October 17, 2010 at 1:58 pm #

      Yes! If you look through the export subroutine portion of the script, you’ll see a line of code that begins:

      do shell script "/usr/bin/textutil -convert webarchive "

      Change “webarchive” to “txt”. This MAN page for textutil should help you figure out how it works in more detail.

      If you’re not comfortable editing scripts, you could also use another script that I’ve published to export notes to RTFD files and then import those into DEVONthink Pro.

      • OogieM October 17, 2010 at 2:34 pm #

        Also have to change the line above to be

        set Make_Archive to ArchiveInput &amp; CleanTitle &amp; ".txt"

        but it’s working now

        Thanks

  21. Tony December 22, 2010 at 11:28 am #

    Hí,

    I get the following,
    “Failed to export due to the following error:
    Can’t get applicatyion id “com.devon-technologies.thinkpro2”.

    I am have copied the script to the right place and it works till i select “export notes”

    • Justin Lancy December 22, 2010 at 12:33 pm #

      Hi Tony — Can you tell me which version of DEVONthink Pro and Evernote you’re using?

      • Tony December 23, 2010 at 6:38 am #

        Justin,

        DEVONthink Pro v 2.0.6 – Evernote v2.0 (116546)

        Thanx Tony

        • Justin Lancy December 23, 2010 at 11:15 am #

          Hi Tony,

          I haven’t been able to reproduce the error here.

          One more shot: Does it work with certain types of notes (text, for example) and not with others (PDFs)?

          • Tony December 24, 2010 at 5:40 am #

            Justin,

            it works with nothing, plane txt or tx with link and/or pictures, i get the same massage.

            Can i have installed Devonthink wrong?

            Thanx Tony

          • Justin Lancy December 25, 2010 at 12:17 pm #

            I’m not really sure why you’re getting this error… (And this is the first time I’ve ever heard of someone getting this error!)

            Sorry — wish I could be of more help, but I’ll keep thinking on this and will post an update if I can reproduce the problem and come up with a fix. In the meantime, you might double-check that your DEVONthink app is properly installed.

          • Tony January 5, 2011 at 3:48 pm #

            I have removed en reinstalled Devonthing. Same error en problem.

            Thanx Tony

  22. Bob February 25, 2011 at 10:30 am #

    “Version 1.3 changes the “Creation” and “Last Modified” dates to match the original item in Evernote. ” This is not working for me. The dates are always the current date. Any suggestions?

    Thanks

    • Justin Lancy February 26, 2011 at 4:12 pm #

      Hi Bob,

      I haven’t been able to recreate this bug!

      I just moved the script source code over to the Code Library in advance of some updates I’ll be doing in the weeks ahead. Save the version from that page and try things again.

      If you still get the date issue, fill me in on the details of your setup and I’ll see if I can help you troubleshoot things from there!

      • Bob February 27, 2011 at 7:20 am #

        Justin,

        The script will not set dates or tags if pdf. Only for (*.. OR CONVERT TO WEBARCHIVE FILE*). If works by modifying your script to include pdf’s.

        Thanks,
        Bob

        • Oliver April 25, 2011 at 3:36 am #

          Justin,

          I can second this. The date is not correct for PDFs and I would be really grateful to have this feature for PDFs too!

          Happy Easter
          Oliver

  23. Nick July 25, 2011 at 10:59 am #

    Hi Justin,

    Thanks for these scripts. I am testing out for the first time on Lion with Evernote 2.2.3 and DevonTHINK Pro 2.2, with notes that consist of photos taken on my iPhone with EverClipper and uploaded to Evernote, and all I am seeing in DT Pro after running the script is Web Archives of less than 1KB with a URL index.html and nothing showing in the content of the note.

    Nick

    • Justin Lancy July 25, 2011 at 11:54 am #

      Hi Nick,

      To clarify — You’re running them for the first time and that just happens to be on Lion, or you’ve just ran them for the first time since upgrading to Lion? (Trying to zero in on if this is a new Lion-related thing, or something to do with the photo notes themselves)

      • Nick July 25, 2011 at 11:56 am #

        Running for the first time and happens to be on Lion. Never used your scripts before.

  24. Jeff MacKie-Mason September 7, 2011 at 10:59 pm #

    Justin, giving it a try. Looks like a promising solution to an irritating problem, thanks. One thing: my first note import uncovered a minor bug: If the name of the note has forward slashes in it, the script fails because you try to create a subdirectory using the name of the note. Indeed, based on this, there are probably a number of other characters that folks might use in the title to a note that would crash the script because they aren’t permitted in folder names.

  25. Ray November 1, 2011 at 6:40 pm #

    Will this script work with DT Personal ? Or does it need DT Pro only to work?

    It would be great if it could work for DT Personal as well.

  26. Jacques February 8, 2012 at 6:58 am #

    Fantastic. I can import the selected notes into the chosen Devonthink folder and the tags are added as well. I have everything categorise without using extra space.
    Thanks a lot for this wonderful script. So far works OK.

  27. Jimmy March 4, 2013 at 6:39 pm #

    Anyone else seeing a sandboxd error “deny file-read” error from Evernote? As of today the script fails to read the Devonthink file

    04/03/13 6:30:55.292 PM sandboxd[21413]: ([9792]) Evernote(9792) deny file-read-data /Users/user/Library/Application Support/DEVONthink Pro 2/Inbox.dtBase2/Files.noindex/pdf/d/2013_03_04_15_54_07.pdf

  28. MarkW March 12, 2013 at 5:56 pm #

    The script seems to have stopped working with the latest DTP update (2.5.1)? At least, it worked for me last week but now nothing happens when I try to run the script

    • Justin Lancy March 13, 2013 at 2:56 am #

      Still working for me… Anyone else have the script stop working after an update to DEVONthink Pro 2.5.1?

      • ChiaLynn March 19, 2013 at 10:17 am #

        Mine has stopped working, as well. DTP 2.5.1, Evernote 5.0.7, OS X 10.8.3. It gets as far as exporting the HTML file, but doesn’t complete the import or delete the HTML folder.

        • Justin Lancy March 22, 2013 at 6:18 am #

          I’m starting to get reports from people about errors with the new 5.0.7 version of Evernote… will investigate.