Export from Evernote to Yojimbo with AppleScript

Yojimbo

Want to quickly export your Evernote entries into Yojimbo? Read on!

Features

  • This script exports a copy of all the selected entries in an Evernote notebook and saves them into Yojimbo.
  • Automatic Growl detection has also been enabled which will save you a trip to the Script Editor to enable/disable it.

Current Limitations and Open Issues

(Otherwise known as “Places Where You Could Help Out!”)

  • Currently, links to audio clips from Evernote will appear to import into Yojimbo. However, the links are non-functional. I’ll look at what can be done about this in future revisions (and based on popular consensus);
  • Errors that will undoubtedly arise when you do something that I didn’t think of or test for! 😉

Change Log:

  • 1.02 (October 19, 2009) BUGFIX FOR ADDITIONAL CASE OF “Can’t get item 1 of {}” ERROR (“find notes”/quotation issue)
  • 1.01 (October 18, 2009) BUG FIXES (“Can’t get item 1 of {}” ERROR, UPDATED/FIXED GROWL NOTIFICATIONS)
  • 1.00 (October 2, 2009) INITIAL RELEASE OF SCRIPT

How to Install and Use

The code is now housed in the Veritrope.com Code Library (See Link Below)

Here’s the link to get the AppleScript — Dive in, check it out, and tell me how to make it better in the comment thread on the Script’s new page!

And remember:

  1. These scripts are being provided for the benefit of the Mac community. While they work wonderfully for me, I can not take responsibility for any data you might lose (or if your laptop turns into a pumpkin or something…);
  2. “Community” means “participation”. Please share with the rest of us *how* you use these scripts in your work flow, how you think they could be impro­ved (and feel free to help someone if they don’t understand something!)

Is there a script to do the reverse?

Click here for the Yojimbo to Evernote Script!

Interested in what other scripts are available for Evernote?

Click here to see the latest list!

28 Responses to “Export from Evernote to Yojimbo with AppleScript”

  1. Fred Zelders October 5, 2009 at 6:00 am #

    Great script! It saved me a lot of time.

    Thanks!

    • Justin October 5, 2009 at 8:15 am #

      Glad you liked it Fred!

  2. jordan October 12, 2009 at 4:59 pm #

    I keep getting the same error on a PDF: “Can’t get file 1 of {}”

    • Justin October 12, 2009 at 7:08 pm #

      Hi Jordan,

      A quick suggestion — make sure that the initial “Select Evernote Notebook” is visible by looking for the bouncing Evernote icon in your Dock and, if you see it, clicking on it. Often that error results from that window “timing out”.

      If you’ve received that error after selecting a notebook, then let me know which versions of Evernote and Yojimbo you’re using and I’ll take a deeper look.

      But, if your problem is solved, let me know that as well! 😀

      • Justin October 12, 2009 at 8:54 pm #

        One more thing, Jordan — This *might be* related to the way Evernote handles items in the Trash.

        Try to empty Evernote’s trash and let me know if this solves the problem!

  3. Justin October 19, 2009 at 8:29 pm #

    Fix is posted in release version 1.02!

  4. Kenji Mapes October 26, 2009 at 4:03 pm #

    Awesome work.

  5. AB December 21, 2009 at 5:02 pm #

    The only quibble, and forgive me for not being a coder or I’d submit a patch, is that if you’re silly enough to clip the same note twice, the script always craps out, I’m guessing because of some information that’s duplicated (like the title). So that would call for a check and the addition of a -n to the end of the filename if true. You could also do duplicates checking, I suppose, but why bother? The key is to have the script run without interruption. Thanks for a fine script.

    • Justin December 21, 2009 at 5:17 pm #

      AB,

      That’s not a “quibble” — it’s a very constructive suggestion!

      I presume that when you say “-n”, you mean that a number should be appended to the Title (what I would call an “n+1″ count”) — the final result being something like “Title #2”, “Title #3”, etc. ?

      If this is something that you and others think would be helpful, I’ll code it into to the next revision!

      Anyone else agree? Additional suggestions?

      • Jonathan December 26, 2009 at 2:10 am #

        Having the script handle duplicate titles gracefully would really be helpful.

        Also, though, the script keeps spitting out an error for most of my notes, and I think I’ve pinned down the reason: It seems that you built in a workaround for quotation marks in titles, but I think the issue with quotation marks extends to note bodies, as well. The error 1728 I’m getting seems to occur on notes with quotation marks anywhere in their bodies, even if they don’t have them in the title. It would really be great if you could fix this, as then this script would be incredibly useful for me. I would fix it myself, but I don’t know AppleScript.

        Also, one last question: You say there’s a bug with handling of links to audio files–does that apply to audio notes I’ve recorded with the Evernote iPhone app? If so, that is another bug that I would really need to be fixed before this app is truly useful. If all these things get fixed, I would definitely be willing to donate. Thanks a lot for all your great work.

        Jonathan

        • Justin December 27, 2009 at 11:52 pm #

          AB and Jonathan,

          A brief update:
          My first step of script debugging is to try and replicate the conditions which caused the thing to fail in the first place.

          After working with a few different samples, here’s the latest…

          — I was only able to reproduce your quotation-in-the-title errors *some of the time*… I think I’ve zeroed in on where the thing chokes and it should be fixed in the next revision.

          — I was *NOT* able to reproduce the quotation-in-the-body errors. Was there any punctuation in the title of the note?

          — While the script doesn’t have the “n+1” duplicate naming feature yet, duplicate notes do not cause the script to fail on my test computer. For me, Yojimbo just creates a new note with the same name. Anyone else having the script stop when it sends a duplicate note to Yojimbo?

          — Finally, “the audio note issue” is, in part, a limitation of Yojimbo and Evernote themselves.

          As far as I can tell, even though Yojimbo wasn’t designed to be a media manager per se, a note will allow you to create a link to an audio file if you drop the file into it. Evernote will allow you to export an audio note but, given the way this script is designed to create a temporary folder which is deleted after export, it would probably be better to create a custom script to do what you want.

          That said, I think there will be compelling reasons to keep audio notes in Evernote in 2010. A recent interview with Phil Libin (CEO of Evernote) suggests that built-in voice transcription is on the way. Once those voice notes get added to a searchable index….. 😉

          • Jonathan December 28, 2009 at 12:25 am #

            Justin,

            -Once I get home, I will check about other punctuation in the titles of the notes it chokes on. I could be wrong about it being the quotation marks in the bodies, but in a (pretty) superficial test, it seemed like all the notes it was choking on had quotation marks in the bodies and all the ones it wasn’t choking on didn’t. But I will check on other punctuation and I will also create new test notes to try to replicate it.

            -Since I haven’t been able to export my notes yet due to the above issue, I don’t know how it handles duplicates; I was only basing my comment on AB’s implication. But if you’re saying it just creates notes with the same title with no problems, that’s actually the behavior I would prefer over the sequential numbering scheme.

            -Regarding the audio notes: The whole reason I want to export my notes from Evernote to Yojimbo in the first place is because I have over a thousand notes in Evernote that I never bothered to tag, and I want to get them organized. Yojimbo has a much better tagging UI for what I need, because it lets me apply groups of tags in batch, something it seems Evernote can’t do. Being able to do that will save me hours of work. So what I want to do is export all my notes from Evernote to Yojimbo, tag them in Yojimbo, then export them from Yojimbo back to Evernote. And many of my notes that need to be tagged are audio notes. Do you think it would be possible to implement some sort of capability for this in the script? I don’t even care if it’s a workaround–it could create a dummy note in Yojimbo that won’t even play the audio file, as long as I can add tags to the note and be able to export the note back into Evernote and have it be fully functional once in Evernote.

            Also, do you think my whole plan of using Yojimbo just to tag is foolish? Does any metadata on the notes (like creation date, modification date, creation location from the iPhone app, etc.) get lost in either of the two legs of the transfer when using your scripts? Is there a way you could modify the scripts to preserve that data? That would be amazing.

            Thanks a lot for all your help.

            Jonathan

          • Justin December 29, 2009 at 12:19 pm #

            Jonathan,

            Let me know about the punctuation when you have a moment. User reports like yours really help me to find and fix things much more quickly!

            As pertains to your Yojimbo=>Evernote=>Yojimbo concept, it’s certainly *possible* to do it that way, but personally I wouldn’t recommend it.

            Let start here — Have you already tried Evernote’s built-in way to add a tag to multiple notes? Many people don’t realize that you can do this by:

            Selecting all the notes you’d like to add the same tag to, and;
            Dragging-and-dropping them onto the tag in the sidebar’s Tag List.

            The virtue of this approach is, of course, it keeps everything in Evernote and reduces the risk of your other metadata being changed (like creation date, creation location, etc.).

            I have also been pushing for Evernote to add some additional support for tagging and attachments in AppleScript and I’m optimistic that it’ll happen eventually. (I actually have a skeleton of a “Bulk Tagger Script” ready to go in anticipation!) A brief post from you to the Evernote forum saying “Hey — Could you make AppleScript a priority?” might help us get there sooner…. squeaky wheels and such! 😉

            If the drag-and-drop approach isn’t going to do the trick, let me know more about *how* you need to tag and maybe I can help you brainstorm an alternate approach.

  6. Justin October 19, 2009 at 5:56 pm #

    With Andrè Fincato’s help, I think we’ve found a bug in the way the script handles typography. Great work, Andrè!

    I’m going to try to code a work-around as soon as possible — stay tuned!