ericshapiro 0 Posted February 23, 2009 Share Posted February 23, 2009 I've got 400+ notes in Apple Mail.app.What's the easiest way to import these into Evernote?I tried the Import... feature, but this wouldn't let me select my notes mailbox, even after I tried to Archive the Notes mailbox.Thanks! Link to comment
engberg 89 Posted February 24, 2009 Share Posted February 24, 2009 If you can get Mail.app to export your notes as separate files (either RTF or plain text), you can then import these into Evernote by dragging them on to our dock icon. I tried selecting several notes and either copying or Save As from Mail.app, and it seemed to always want to create a single block of text in a file rather than multiple files. Link to comment
ericshapiro 0 Posted February 24, 2009 Author Share Posted February 24, 2009 Yes, that's exactly the problem. How do I get Apple Mail to export Notes into multiple files, preferably without all the email headers. Anybody have a script, or something to tear apart mbox files? Link to comment
pdxmph 5 Posted February 25, 2009 Share Posted February 25, 2009 This is very easy in Ruby using appscript.The main point is, the notes have to be dragged into a new mailbox. For whatever reason, the Notes "folder" doesn't exist where Mail's scripting is concerned. In this example, I made a new mailbox called "NoteMigrate" so it appeared under "On My Mac." The script will create a notebook called "ImportedMessages" if you don't have one already, and it will tag each note with "imported_note."The first line of a given note is the 'subject.' All the lines of a note, including the first, are the content.#!/usr/bin/rubyrequire 'rubygems'require 'appscript'include Appscripten = app("Evernote")mail = app("Mail")notes_folder = mail.mailboxes["NoteMigrate"]messages = notes_folder.messages.getmessages.each do |m| en.create_note(:title => m.subject.get, :notebook => "ImportedNotes", :with_text => m.content.get, :tags => "imported_note")endI don't do much scripting with Applescript directly because I got more fluent with Ruby using rb-appscript much more quickly. The logic is so straightforward I'm sure an adept Applescripter will be able to translate it. If nobody shows how in a day or two, I'll do it. 1 1 Link to comment
pdxmph 5 Posted February 25, 2009 Share Posted February 25, 2009 Well, it was pretty easy in AppleScript, too, since I had some scrap code from a while back. Same deal as before: Drag all the notes into a new mailbox called "NoteMigrate."No error checking or anything. Worked for me:tell application "Mail" set theMessages to every message of the mailbox "NoteMigrate" repeat with thisMessage in theMessages set myTitle to the subject of thisMessage set myText to the content of thisMessage tell application "Evernote" create note with text myText title myTitle notebook "Imported Notes" tags "imported_note" end tell end repeatend tell 2 Link to comment
ericshapiro 0 Posted February 25, 2009 Author Share Posted February 25, 2009 Wow, that's great. You rock!And with two different options, no less! Link to comment
temoore 0 Posted May 25, 2010 Share Posted May 25, 2010 Works great, but Is the created or last modified date available to add to this import code? That's pretty important sometimes, and the fact that Mail.app notes doesn't seem to track date created is one of the problems that motivated my search for Evernote. Link to comment
pdxmph 5 Posted May 25, 2010 Share Posted May 25, 2010 You just need to grab the "date sent" attribute when you look at the original note, then add it as the "created" property to the newly created Evernote item.The AppleScript version:tell application "Mail" set theMessages to every message of the mailbox "NoteMigrate" repeat with thisMessage in theMessages set myTitle to the subject of thisMessage set myText to the content of thisMessage set myCreateDate to the date sent of thisMessage tell application "Evernote" create note with text myText title myTitle notebook "Imported Notes" tags "imported_note" created myCreateDate end tell end repeatend tellThe Ruby/rb-appscript version:#!/usr/bin/rubyrequire 'rubygems'require 'appscript'include Appscripten = app("Evernote")mail = app("Mail")notes_folder = mail.mailboxes["NoteMigrate"]messages = notes_folder.messages.getmessages.each do |m| en.create_note(:title => m.subject.get, :notebook => "ImportedNotes", :with_text => m.content.get, :tags => "imported_note", :created => m.date_sent.get)end 1 Link to comment
temoore 0 Posted May 27, 2010 Share Posted May 27, 2010 Ok, now I admit it too; you rock! Link to comment
ggoodman1963 0 Posted June 9, 2011 Share Posted June 9, 2011 Simply incredible. I've been trying to get my 250 notes from my old blackberry to my new imac and iphone for two months. Thanks so much. Link to comment
oyalhi 0 Posted August 23, 2011 Share Posted August 23, 2011 I admit it too, you rock! Thanks Link to comment
kevin_x1000 2 Posted September 22, 2012 Share Posted September 22, 2012 Apple Script version: This worked great, but as a first time user of apple script, I had to figure out a few things.1. Open up the application "Apple Script Editor."2. Paste in the text from the post above.3. Open Mail application. Control-click on "inbox" and make a "New Mailbox..." and name it "NoteMigrate."4. Select all your notes and move them into the new folder "NoteMigrate."5. Open Evernote app on your Mac. (not sure this is necessary, but I did it)6. Go back to Apple Script Editor. Hit Compile. (not sure compile is necessary, but I did it)7. Click the icon "Run."8. Wait.9. Go back to Evernote, and see the result.10. Dance. (not sure this is necessary, but I did it) 2 Link to comment
CJEch 0 Posted January 4, 2013 Share Posted January 4, 2013 This method indeed rocks, but there's still one more detail before you get the full A+...The capture of creation was a nice improvement, but many users also like to sort the notes based on date updated, from most recent to least recent, right?The output from your script currently creates a rather awkward situation, since it actually reverses this order due to the fact that the "updated" date defined in Evernote for the newly imported notes is set by the order in which they are imported, and it seems that the script by default imports them starting from the most recently updated to least recent, as defined in the Mac's Note database. Once they land in evernote, they all have the correct original creation dates (lovely!), but they all have today's import date and time for their "updated" values (so they all differ by about 1 seoncd or so, as the script was walking through the list).Tried a quick "dumb fix" of reversing the sort order in Mac Mail prior to import but this doesn't help, since it is just a viewing option: the script apparently follows the order set by the last modified date of these notes.So I see two possible fixes, neither of which I can implment myself, as I don't know enough about scripting, so I'm greatly appreciate if one of you could help here:-the smart fix: figure out how to capture the "last updated" values from the Mac database, and use them to reset the corresponding "updated" values in Evernote after the import is complete.-the acceptable work-around: if resetting the "updated" values correctly is not possible, then you could maybe get the script to at least least reestablish the correct "updated" order by altering this order either before or after the import, by getting either Mac Mail or Evernote to go into each of the notes in the reverse order and adding a benign edit (e.g. an extra space or punctuation character at the very end of the note text field). This would result in the correct "udpated-based sorting", at the modest price of losing the actual last update dates from before the import process.Make sense?If so, I'd greatly appreciate if pdxmph (or anyone else with the right scripting know-how) would be wiling to update the script accordingly... Which would then get A+ rock status in my book as well... ;-)Cheers! Link to comment
thedave42 0 Posted March 22, 2013 Share Posted March 22, 2013 To make the AppleScript version add in reverse order: tell application "Mail" set theOMessages to every message of the mailbox "NotesExport" set theMessages to reverse of theOMessages repeat with thisMessage in theMessages set myTitle to the subject of thisMessage set myText to the content of thisMessage set myCreateDate to the date sent of thisMessage tell application "Evernote" create note with text myText title myTitle notebook "Imported Notes" tags "imported_note" created myCreateDate end tell end repeatend tell Link to comment
Calion 22 Posted September 25, 2013 Share Posted September 25, 2013 When I run these scripts, after importing five notes, Evernote returns Internal Error.An internal database error has occurred that prevents Evernote from functioning properly. If the problem persists, please contact Evernote Support. Link to comment
Calion 22 Posted September 26, 2013 Share Posted September 26, 2013 What's happening is that Evernote balks at titles that are too long. I'm trying to figure out how to fix this. Link to comment
Calion 22 Posted September 26, 2013 Share Posted September 26, 2013 Here's a fix I kludged up. I'd much rather have it pick, say, the first four words, but when I tried that it came out allruntogether, and I didn't see an easy way to remedy that. tell application "Mail"set theOMessages to every message of the mailbox "NotesExport"set theMessages to reverse of theOMessagesrepeat with thisMessage in theMessagesset myTitle to the subject of thisMessageset myCount to count characters of myTitleif myCount is greater than 20 thenset theTitle to characters 1 through 20 of myTitle as stringelseset theTitle to myTitleend ifset myText to the content of thisMessageset myCreateDate to the date sent of thisMessagetell application "Evernote"create note with text myText title theTitle notebook "Imported Notes" tags "iOS" created myCreateDateend tellend repeatend tell Link to comment
d.b.walker 5 Posted October 24, 2013 Share Posted October 24, 2013 Modified this script to work with Mavericks Notes, which is no longer in the mail app.Added the original creation and modification datesAdded multiple tags - replace with your own Did not add the long note name fix (I needed to preserve my note names) tell application "Notes"set theMessages to every noterepeat with thisMessage in theMessagesset myTitle to the name of thisMessageset myText to the body of thisMessageset myCreateDate to the creation date of thisMessageset myModDate to the modification date of thisMessagetell application "Evernote"set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "Mavericks", "Another_Example_Tag"]set the HTML content of myNote to myTextset the creation date of myNote to myCreateDateset the modification date of myNote to myCreateDateend tellend repeatend tell Enjoy 5 Link to comment
bensus 0 Posted February 14, 2014 Share Posted February 14, 2014 Bloody brilliant mate (and to all who've contributed) works like a charm. Link to comment
AnthonySJ 0 Posted May 6, 2014 Share Posted May 6, 2014 I currently have over 500 notes on my Apple desktop computer in the app notes. I want to move them into Evernote, as separate notes. Having looked at the steps above, 1. I can not get the Notes into my Mailbox, unless I do each one manually. I think it may be the Maverick iOS edition as there is no option for showing notes in Mail. Please could someone advise me on how I can get these Apple Notes on to Mail, then Mail to Evernote.Thanks Link to comment
ScottLougheed 1,316 Posted May 6, 2014 Share Posted May 6, 2014 I currently have over 500 notes on my Apple desktop computer in the app notes. I want to move them into Evernote, as separate notes. Having looked at the steps above, 1. I can not get the Notes into my Mailbox, unless I do each one manually. I think it may be the Maverick iOS edition as there is no option for showing notes in Mail. Please could someone advise me on how I can get these Apple Notes on to Mail, then Mail to Evernote.ThanksYou should be able to use d.b.walker's applescript posted in this very thread (two posts above yours). https://discussion.evernote.com/topic/4046-importing-from-apple-mailapps-notes/?p=236445 Link to comment
AnthonySJ 0 Posted May 7, 2014 Share Posted May 7, 2014 WOW! Thank you very much d.b.Walker and ScottLougheed that just saved me a whole day! Did not realise AppleScript worked like that.. AMAZING! Link to comment
Mikel Duffy 1 Posted June 26, 2014 Share Posted June 26, 2014 Found that not all of my 1500+ notes from Apple's Notes.app had delineated titles. Since the "title" of a note is generally the first line, I was getting errors from Evernote when it was trying to create notes with a title larger than 255 characters. I suppose you could truncate the title to only take the first 255 characters of the title, but I found that setting title to the creation date as a string was more clean. Hope this helps anyone running into the same problem!tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set myTitle to the creation date of thisMessage as string set myText to the body of thisMessage set myCreateDate to the creation date of thisMessage set myModDate to the modification date of thisMessage tell application "Evernote" set myNote to create note with text myText title myTitle notebook "Imported" tags ["imported_from_Apple_notes"] set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myCreateDate end tell end repeatend tell 1 Link to comment
Coach Dale 1 Posted July 27, 2014 Share Posted July 27, 2014 Thanks d.b.walker! It worked perfectly! *Dale* Modified this script to work with Mavericks Notes, which is no longer in the mail app.Added the original creation and modification datesAdded multiple tags - replace with your own Did not add the long note name fix (I needed to preserve my note names) tell application "Notes"set theMessages to every noterepeat with thisMessage in theMessagesset myTitle to the name of thisMessageset myText to the body of thisMessageset myCreateDate to the creation date of thisMessageset myModDate to the modification date of thisMessagetell application "Evernote"set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "Mavericks", "Another_Example_Tag"]set the HTML content of myNote to myTextset the creation date of myNote to myCreateDateset the modification date of myNote to myCreateDateend tellend repeatend tell Enjoy 1 Link to comment
Tondeaf 1 Posted September 11, 2014 Share Posted September 11, 2014 I actually need to truncate the first 255 chars of the title. The script that set the first 20 didn't work...What would the code for that be? Thanks in advance! Link to comment
SurferSteve 0 Posted September 22, 2014 Share Posted September 22, 2014 I'm using the script but it's giving me an ["... Connection is invalid." number -609] error. I end up with about 2/3rds of my 250 Notes imported. I can't see any pattern of which Notes are imported and which aren't. Any suggestions? Thanks d.b.walker! It worked perfectly! *Dale* Modified this script to work with Mavericks Notes, which is no longer in the mail app.Added the original creation and modification datesAdded multiple tags - replace with your own Did not add the long note name fix (I needed to preserve my note names) tell application "Notes"set theMessages to every noterepeat with thisMessage in theMessagesset myTitle to the name of thisMessageset myText to the body of thisMessageset myCreateDate to the creation date of thisMessageset myModDate to the modification date of thisMessagetell application "Evernote"set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "Mavericks", "Another_Example_Tag"]set the HTML content of myNote to myTextset the creation date of myNote to myCreateDateset the modification date of myNote to myCreateDateend tellend repeatend tell Enjoy Link to comment
Kim Nguyen 6 Posted November 11, 2014 Share Posted November 11, 2014 Many thanks from a less than "Programming for Dummies" - level guy who had an intro course to C++ 15 years ago and never coded anything from then on. I was still able to follow procedure! Wow. Very proud of myself. Link to comment
Matt H 1 Posted November 13, 2014 Share Posted November 13, 2014 In case you have Notes from multiple accounts, like I do (some in iCloud, some on Exchange, etc.) you can add this line to pull the account name of the note:set myAccount to the name of the container of the container of thisMessageand then add this line in there to put it into a corresponding Evernote notebook:set myNote to create note with text myTitle title myTitle notebook myAccount tags ["Whatever", "Tags", "you", "want"] Modified this script to work with Mavericks Notes, which is no longer in the mail app.Added the original creation and modification datesAdded multiple tags - replace with your own Did not add the long note name fix (I needed to preserve my note names) tell application "Notes"set theMessages to every noterepeat with thisMessage in theMessagesset myTitle to the name of thisMessageset myText to the body of thisMessageset myCreateDate to the creation date of thisMessageset myModDate to the modification date of thisMessagetell application "Evernote"set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "Mavericks", "Another_Example_Tag"]set the HTML content of myNote to myTextset the creation date of myNote to myCreateDateset the modification date of myNote to myCreateDateend tellend repeatend tell Enjoy 1 Link to comment
*Alex D* 0 Posted November 14, 2014 Share Posted November 14, 2014 Whoohoo ... works great on my macs with Yosemite too!! Link to comment
Kevin Raub 0 Posted November 19, 2014 Share Posted November 19, 2014 Hi! I am also interested in merging my Apple Notes to Evernote. Could someone explain exactly how to run this script in a step-by-step process for people who know nothing about coding, etc? I assume you cut and paste this, but to where? Then you run, and then what? You just open Evernote and everything is there? Could someone outline the exact process? I'm on Yosemite. I don't have any Notes name more than 255 characters. Thanks! kevin Link to comment
ArtProMac 0 Posted November 24, 2014 Share Posted November 24, 2014 I currently have over 500 notes on my Apple desktop computer in the app notes. I want to move them into Evernote, as separate notes. Having looked at the steps above, 1. I can not get the Notes into my Mailbox, unless I do each one manually. I think it may be the Maverick iOS edition as there is no option for showing notes in Mail. Please could someone advise me on how I can get these Apple Notes on to Mail, then Mail to Evernote.Thanks I compiled and created the Application for the beginners http://artpromac.com/ExportNotetoEvernotebyArtProMac.zip Link to comment
yzigarza 0 Posted January 12, 2015 Share Posted January 12, 2015 i can see this script importing my 550 notes to evernote... i trusted the .zip file listed on the link of the last post before me and its just beautifull!!! ( i didnt know where to start with the script)... i agree that the dates are an issue but i finally have acces to my notes so i dont care about the date!!! thanks to all of you!!! you really made my switch from ios to android finally possible! SgtYzi Link to comment
parentint 1 Posted January 18, 2015 Share Posted January 18, 2015 I am running Yosemite (Mac OS X 10.10.1 and consequently Apple Notes 3.1 and with the script below I receive the error: "Syntax Error Notes got an error: AppleEvent handler failed." at line two with "every note" highlighted.Can anyone help? tell application "Notes"set theMessages to every noterepeat with thisMessage in theMessagesset myTitle to the name of thisMessageset myText to the body of thisMessageset myCreateDate to the creation date of thisMessageset myModDate to the modification date of thisMessagetell application "Evernote"set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "Yosemite", "Another_Example_Tag"]set the HTML content of myNote to myTextset the creation date of myNote to myCreateDateset the modification date of myNote to myCreateDateend tellend repeatend tell Link to comment
Level 5* JMichaelTX 4,108 Posted January 18, 2015 Level 5* Share Posted January 18, 2015 I am running Yosemite (Mac OS X 10.10.1 and consequently Apple Notes 3.1 and with the script below I receive the error: "Syntax Error Notes got an error: AppleEvent handler failed." at line two with "every note" highlighted.Can anyone help? tell application "Notes"set theMessages to every note. . . You might try a Google on "applescript select all notes" since the issue seems to be in how you are trying to select all Notes. Link to comment
parentint 1 Posted January 20, 2015 Share Posted January 20, 2015 Hi JMichael,I cannot seem to find any apple script command for 'select all' in notes. But is that even possible? Surely there must be such a command. I can certainly select all notes manually in the notes app, so why would this scripting feature be absent?Thanks ever so much for your help.A. Link to comment
Level 5 Adjusting 276 Posted January 22, 2015 Level 5 Share Posted January 22, 2015 I cannot seem to find any apple script command for 'select all' in notes. But is that even possible? Surely there must be such a command. I can certainly select all notes manually in the notes app, so why would this scripting feature be absent? You could try using keyboard shortcuts. Something like this maybe: tell application "Evernote" activate -- bring the Evernote client forward delay 1 -- wait to make sure the client has fully activated tell application "System Events" keystroke "|" using command down -- Cmd-| to go to the note list keystroke "a" using command down -- Cmd-A to select all end tellend tell Link to comment
Level 5 Adjusting 276 Posted January 23, 2015 Level 5 Share Posted January 23, 2015 I cannot seem to find any apple script command for 'select all' in notes. But is that even possible? Surely there must be such a command. I can certainly select all notes manually in the notes app, so why would this scripting feature be absent? You could try using keyboard shortcuts. Something like this maybe: tell application "Evernote" activate -- bring the Evernote client forward delay 1 -- wait to make sure the client has fully activated tell application "System Events" keystroke "|" using command down -- Cmd-| to go to the note list keystroke "a" using command down -- Cmd-A to select all end tellend tellI now see you were talking about the Notes app. A similar approach should work there too. Link to comment
parentint 1 Posted January 25, 2015 Share Posted January 25, 2015 Sorry I'm such an applescript novice I've no idea how to include your suggestion. I've typed the following script out (and also tried to tweak it), but it gives me the following error: Expected end of line, etc. but found end of script. tell application "Notes"activate -- bring the Notes client forwarddelay 1 -- wait to make sure the client has fully activatedtell application "System Events"keystroke "|" using command down -- Cmd-| to go to the note listkeystroke "a" using command down -- Cmd-A to select allrepeat with thisMessage in theMessagesset myTitle to the name of thisMessageset myText to the body of thisMessageset myCreateDate to the creation date of thisMessageset myModDate to the modification date of thisMessagetell application "Evernote"set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "Yosemite", "Another_Example_Tag"]set the HTML content of myNote to myTextset the creation date of myNote to myCreateDateset the modification date of myNote to myCreateDateend tellend repeatend tell Link to comment
Level 5 Adjusting 276 Posted January 27, 2015 Level 5 Share Posted January 27, 2015 Try this:tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set myTitle to the name of thisMessage set myText to the body of thisMessage set myCreateDate to the creation date of thisMessage set myModDate to the modification date of thisMessage tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "Yosemite", "Another_Example_Tag"] set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myCreateDate end tell end repeatend tell 1 Link to comment
Level 5* JMichaelTX 4,108 Posted January 27, 2015 Level 5* Share Posted January 27, 2015 @Adjusting: I can see that you are an accomplished AppleScript coder. Could you please help us get the AppleScript issues with EN Mac 6.0.5 fixed? Many of use routinely rely on AppleScript in our Evernote workflows. Thanks. Link to comment
Level 5 Adjusting 276 Posted January 27, 2015 Level 5 Share Posted January 27, 2015 @Adjusting: I can see that you are an accomplished AppleScript coder. Could you please help us get the AppleScript issues with EN Mac 6.0.5 fixed? Many of use routinely rely on AppleScript in our Evernote workflows. I’m good at debugging and modifying other people’s scripts, but I don’t know if I could write one from scratch. The issue where find notes did not work with the 'notebook:' syntax should be fixed in 6.0.6 beta 2Which other issues are affecting your workflows? Link to comment
Level 5* JMichaelTX 4,108 Posted January 27, 2015 Level 5* Share Posted January 27, 2015 @Adjusting: Is this the bug that has been fixed in Ver 6.0.6 B2?https://discussion.evernote.com/topic/64280-changing-a-notes-notebook-with-applescript-does-not-sync-properly/ Link to comment
parentint 1 Posted January 27, 2015 Share Posted January 27, 2015 Thank you Adjusting, but I don't see how your script differs from the one I initially tried (see my post dated 18 Jan 10:30AM).Apologies if it is different. Link to comment
Level 5 Adjusting 276 Posted January 27, 2015 Level 5 Share Posted January 27, 2015 Thank you Adjusting, but I don't see how your script differs from the one I initially tried (see my post dated 18 Jan 10:30AM).Apologies if it is different.No, you’re right. There doesn’t seem to be any difference. I was just trying to fix the problems with your latest script (using keyboard shortcuts that don’t exist, using theMessages before setting it, mismatched tell and end...) and didn’t reread the whole thread.What were you trying to accomplish with your latest script that your original didn’t do? Link to comment
parentint 1 Posted January 27, 2015 Share Posted January 27, 2015 Hi Adjusting,What I'm trying to do is the titler of this discussion."Importing from Apple Mail.app's Notes"Except that - as you probably realise - Yosemite has its own stand alone Notes App, meaning notes in Yosemite are no longer stored in the Apple Mail App.Hope that helps.Many thanks Link to comment
Level 5 Adjusting 276 Posted January 27, 2015 Level 5 Share Posted January 27, 2015 What I'm trying to do is the titler of this discussion."Importing from Apple Mail.app's Notes"Except that - as you probably realise - Yosemite has its own stand alone Notes App, meaning notes in Yosemite are no longer stored in the Apple Mail App. Right, but your original script already did that. I’m just trying to figure out what the goal of your changes was. Link to comment
parentint 1 Posted February 17, 2015 Share Posted February 17, 2015 The original script does not work, that's why we're having this discussion. 1 Link to comment
brbell01 0 Posted April 8, 2015 Share Posted April 8, 2015 Excellent! Worked perfectly. Thanks for posting this, Calion.Here's a fix I kludged up. I'd much rather have it pick, say, the first four words, but when I tried that it came out allruntogether, and I didn't see an easy way to remedy that. tell application "Mail"set theOMessages to every message of the mailbox "NotesExport"set theMessages to reverse of theOMessagesrepeat with thisMessage in theMessagesset myTitle to the subject of thisMessageset myCount to count characters of myTitleif myCount is greater than 20 thenset theTitle to characters 1 through 20 of myTitle as stringelseset theTitle to myTitleend ifset myText to the content of thisMessageset myCreateDate to the date sent of thisMessagetell application "Evernote"create note with text myText title theTitle notebook "Imported Notes" tags "iOS" created myCreateDateend tellend repeatend tell Link to comment
Vibol 0 Posted April 8, 2015 Share Posted April 8, 2015 This script will import all your Notes and create folders for each Account. For instance, if you have iCloud and a Gmail account, it will create "Imported iCloud" and "Imported Gmail" folders to store respective notes. It also sets mod date to the correct field. Thanks everyone for creating the base for this.tell application "Notes" set theNotes to every note repeat with thisNote in theNotes set myTitle to the name of thisNote set myText to the body of thisNote set myCreateDate to the creation date of thisNote set myModDate to the modification date of thisNote set myFolder to the container of thisNote set myAccount to the container of myFolder set myAccountName to the name of myAccount set myAccountName to "Imported " & myAccountName set myAccountName to myAccountName as string tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook myAccountName set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myModDate end tell end repeatend tell Link to comment
Socket 2 Posted April 14, 2015 Share Posted April 14, 2015 Nice work everyone - many thanks.Has anyone figured how to include embedded images from your notes in Notes.app to the new Evernote note? 2 Link to comment
MaggieMoo 0 Posted April 28, 2015 Share Posted April 28, 2015 Oh, My, Goodness! I can't believe that I just figured out how to do this! Thank you SOOOO much for putting the notes here. I have spent at least 1.5 hours trying to figure out something that "should" be simple - just download about 30 notes from my MacBook Notes to Evernote. I "ran the script" that you suggested, and I am not sure what it really did, but now I see all these notes in Evernote. Now, if my computer starts smoking, and little bugs start running out, I will know that it didn't work as well as I think, but thanks so much! I feel so proud of myself, because I think I just "programmed" my computer, or something like that!!Thanks again, Evernote geeks! Link to comment
bayoyong 0 Posted May 28, 2015 Share Posted May 28, 2015 Modified this script to work with Mavericks Notes, which is no longer in the mail app.Added the original creation and modification datesAdded multiple tags - replace with your own Did not add the long note name fix (I needed to preserve my note names) tell application "Notes"set theMessages to every noterepeat with thisMessage in theMessagesset myTitle to the name of thisMessageset myText to the body of thisMessageset myCreateDate to the creation date of thisMessageset myModDate to the modification date of thisMessagetell application "Evernote"set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "Mavericks", "Another_Example_Tag"]set the HTML content of myNote to myTextset the creation date of myNote to myCreateDateset the modification date of myNote to myCreateDateend tellend repeatend tell Enjoy How do I do this in Mavericks? Run in Apple Script Editor? Does Evernote need to be open? Link to comment
bayoyong 0 Posted May 28, 2015 Share Posted May 28, 2015 Dude. That totally worked. Thx so much! Link to comment
jo4o 0 Posted July 1, 2015 Share Posted July 1, 2015 Nice work everyone - many thanks.Has anyone figured how to include embedded images from your notes in Notes.app to the new Evernote note?Thanks for the work of all.Any news of that issue? I can not figure out how to export the body (text) + attachments (images) of Notes.app to Evernote. Best Link to comment
RZshred 0 Posted July 10, 2015 Share Posted July 10, 2015 This thread is awesome and d.b.walker your script is amazing and worked like a charm- it did in seconds something which would have taken me hours to do manually. Link to comment
daMuch 0 Posted November 18, 2015 Share Posted November 18, 2015 Worked like a charm, for all of my different accounts in the notes app ( local, gmail, icloud)Cheers to you, sir! This script will import all your Notes and create folders for each Account. For instance, if you have iCloud and a Gmail account, it will create "Imported iCloud" and "Imported Gmail" folders to store respective notes. It also sets mod date to the correct field. Thanks everyone for creating the base for this.tell application "Notes" set theNotes to every note repeat with thisNote in theNotes set myTitle to the name of thisNote set myText to the body of thisNote set myCreateDate to the creation date of thisNote set myModDate to the modification date of thisNote set myFolder to the container of thisNote set myAccount to the container of myFolder set myAccountName to the name of myAccount set myAccountName to "Imported " & myAccountName set myAccountName to myAccountName as string tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook myAccountName set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myModDate end tell end repeatend tell Link to comment
Elias Zamaria 0 Posted March 24, 2016 Share Posted March 24, 2016 The script in this thread was helpful, but some of the modification dates for my notes were not right after I imported them. I think there is a bug in the script. The line that says set the modification date of myNote to myCreateDate should say set the modification date of myNote to myModDate instead. Link to comment
Level 5* JMichaelTX 4,108 Posted March 25, 2016 Level 5* Share Posted March 25, 2016 On 3/24/2016 at 11:24 PM, Elias Zamaria said: I think there is a bug in the script. Good catch! Thanks for reporting. @d.b.walker, if you are still around, could you please update your post/script to fix this bug so others do not encounter it. Since that script is the one and only post of @d.b.walker, I suspect he may not be active in the forum. So, I'm posting his code, with the bug fix identified by @Elias Zamaria, to make it easy for others to find in the future.From the original script by @d.b.walker, with bug fix: tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set myTitle to the name of thisMessage set myText to the body of thisMessage set myCreateDate to the creation date of thisMessage set myModDate to the modification date of thisMessage tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "Mavericks", "Another_Example_Tag"] set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myModDate -- BUG FIX end tell end repeat end tell NOTE: I have not tested this code, so I can NOT vouch for it. Use at your own risk. Link to comment
Matthew Sangster 3 Posted September 1, 2017 Share Posted September 1, 2017 I've made a minor adjustment to this code, it preserves folders and account by making a new notebook for each folder (within an account) and tags the account the note is associated with. This can be easily switched if you prefer your notebooks to be based on accounts and tagged with the folders. tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set myTitle to the name of thisMessage set myText to the body of thisMessage set myCreateDate to the creation date of thisMessage set myModDate to the modification date of thisMessage set thisItem to thisMessage set myAccount to null set myFolder to null repeat set thisContainer to the container of thisItem if (the class of thisContainer) is folder then set myFolder to name of thisContainer else if (the class of thisContainer) is account then set myAccount to name of thisContainer end if if myFolder is not null and myAccount is not null then exit repeat else set thisItem to thisContainer end if end repeat tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook myFolder tags myAccount set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myCreateDate end tell end repeat end tell if you want to make the notebook names from accounts and the tags from folders (opposite of what I have), you would change "set myNote to create note with text myTitle title myTitle notebook myFolder tags myAccount" to "set myNote to create note with text myTitle title myTitle notebook myAccount tags myFolder". 3 Link to comment
Rafael Aviles 0 Posted October 31, 2017 Share Posted October 31, 2017 Thank you Matthew. For some reason, none of the HTML or attachments in my Notes get exported to Evernote with your script or the original script, just the plain text, title, and dates. A lot of my notes have HTML links to the original web pages I created them from. How can i migrate that? Link to comment
Shauli 1 Posted December 23, 2017 Share Posted December 23, 2017 On 9/1/2017 at 8:20 PM, Matthew Sangster said: I've made a minor adjustment to this code, it preserves folders and account by making a new notebook for each folder (within an account) and tags the account the note is associated with. This can be easily switched if you prefer your notebooks to be based on accounts and tagged with the folders. tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set myTitle to the name of thisMessage set myText to the body of thisMessage set myCreateDate to the creation date of thisMessage set myModDate to the modification date of thisMessage set thisItem to thisMessage set myAccount to null set myFolder to null repeat set thisContainer to the container of thisItem if (the class of thisContainer) is folder then set myFolder to name of thisContainer else if (the class of thisContainer) is account then set myAccount to name of thisContainer end if if myFolder is not null and myAccount is not null then exit repeat else set thisItem to thisContainer end if end repeat tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook myFolder tags myAccount set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myCreateDate end tell end repeat end tell if you want to make the notebook names from accounts and the tags from folders (opposite of what I have), you would change "set myNote to create note with text myTitle title myTitle notebook myFolder tags myAccount" to "set myNote to create note with text myTitle title myTitle notebook myAccount tags myFolder". works amazing can you make all of the attached pictures and pdf inside the notes to transfer to? this will be wonderful Link to comment
Shauli 1 Posted January 10, 2018 Share Posted January 10, 2018 please people I am willing to donate money for this it is very important to me ill send you money via PayPal Link to comment
lw116 0 Posted November 2, 2018 Share Posted November 2, 2018 Has anyone had luck with this script in High Sierra? I was able to run this before on an older version of Mac OS, but now I am seeing errors: "Evernote got an error: The operation couldn't be completed. (Evernote XML Error error 4.)" I posted my question here, but haven't gotten help there either. Link to comment
Level 5* DTLow 5,721 Posted November 2, 2018 Level 5* Share Posted November 2, 2018 25 minutes ago, lw116 said: Has anyone had luck with this script in High Sierra? I was able to run this before on an older version of Mac OS, but now I am seeing errors: "Evernote got an error: The operation couldn't be completed. (Evernote XML Error error 4.)" Could you post the actual script you're trying to run I ran this script without any errors. However, this only copies the text. It does not copy any attachments. Link to comment
Everlast24 1 Posted December 12, 2018 Share Posted December 12, 2018 Hello everyone, The above code works brilliantly to transfer all my notes (thanks a lot!!). However, I can't manage to transfer the titles. Anything more than 70-80 characters gets truncated. Hence, the first paragraph from IoS notes is being lost. i.e First paragraph In IOS - "Volatility spread, maturity price matrix. They are using pd matrix for maximum 3-4 dimensions. For anything bigger than that Monte-Carlo simulation is used. " Title in Evernote - "Volatility spread, maturity price matrix. They are using pd matrix…" The second part of the above sentence does not appear anywhere in Evernote. is it possible to transfer the ios note title into the body of the evernote note and rename the note by the date created? Many thanks in advance. 1 Link to comment
Greendays Group 1 Posted December 31, 2018 Share Posted December 31, 2018 On 9/1/2017 at 10:20 AM, Matthew Sangster said: I've made a minor adjustment to this code, it preserves folders and account by making a new notebook for each folder (within an account) and tags the account the note is associated with. This can be easily switched if you prefer your notebooks to be based on accounts and tagged with the folders. tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set myTitle to the name of thisMessage set myText to the body of thisMessage set myCreateDate to the creation date of thisMessage set myModDate to the modification date of thisMessage set thisItem to thisMessage set myAccount to null set myFolder to null repeat set thisContainer to the container of thisItem if (the class of thisContainer) is folder then set myFolder to name of thisContainer else if (the class of thisContainer) is account then set myAccount to name of thisContainer end if if myFolder is not null and myAccount is not null then exit repeat else set thisItem to thisContainer end if end repeat tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook myFolder tags myAccount set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myCreateDate end tell end repeat end tell if you want to make the notebook names from accounts and the tags from folders (opposite of what I have), you would change "set myNote to create note with text myTitle title myTitle notebook myFolder tags myAccount" to "set myNote to create note with text myTitle title myTitle notebook myAccount tags myFolder". It's the end of 2018 and this code still works to transfer Notes into Evernote. It ends with an error but a hand-audit revealed all notes made it into Evernote. This solution should be elevated within Evernote Support documents. Took a *ton* of time searching Google before tripping across this. If you need to export Apple Notes into Evernote... this is by far the fastest & easiest way to do it. 1 Link to comment
dejalu 0 Posted May 28, 2019 Share Posted May 28, 2019 Hello. This thread is very informative. Thank you. I was able to transfer my notes to evernote. However, my titles run longer than the character limit and are truncated by Apple notes during export. My notes were not written with titles in mind and I did not realize the first line would be set to the title. I tried concatenating the title to the body, but the title is truncated when it is set to the myTitle variable. Is there a good way to preserve the full apple notes title? Or does this require modifying every apple note with a new title to push the first line down into the body. Link to comment
Level 5* JMichaelTX 4,108 Posted June 3, 2019 Level 5* Share Posted June 3, 2019 On 5/28/2019 at 4:17 PM, dejalu said: My notes were not written with titles in mind and I did not realize the first line would be set to the title. I tried concatenating the title to the body, but the title is truncated when it is set to the myTitle variable. Is there a good way to preserve the full apple notes title? As you say, Evernote Mac has a limit on the Note Title length, so you will either have to revise the text for the title, or let it be truncated. I'm not clear on what action you want to perform at this time. Do you want to modify the Evernote Notes that you imported from Apple Notes? OR, do you want to re-import the Apple Notes and handle the Note Title differently? How many Notes need to be revised? What script did you use to import the Apple Notes? Once we clearly understand what you want to do at this point, most likely there is a simple AppleScript solution. Link to comment
Level 5* DTLow 5,721 Posted June 4, 2019 Level 5* Share Posted June 4, 2019 On 5/28/2019 at 2:17 PM, dejalu said: I was able to transfer my notes to evernote. However, my titles run longer than the character limit and are truncated by Apple notes during export. My notes were not written with titles in mind and I did not realize the first line would be set to the title. We're not clear on which script you used, can you post it? I'm thinking Apple Note titles would be comparable with Evernote titles, and for the most part the notes would be equivalent. Can you provide specific examples (screenshots) You have control with the script, and should be able to make adjustments as required. Link to comment
Walle3546 0 Posted July 15, 2019 Share Posted July 15, 2019 I was sent here by DoraOutLoud: https://medium.com/doraoutloud/migrating-your-apple-notes-to-evernote-12114418ba00 It's July 14, 2019, and the following code worked for me. Thank you all. On 12/31/2018 at 2:30 PM, Greendays Group said: tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set myTitle to the name of thisMessage set myText to the body of thisMessage set myCreateDate to the creation date of thisMessage set myModDate to the modification date of thisMessage set thisItem to thisMessage set myAccount to null set myFolder to null repeat set thisContainer to the container of thisItem if (the class of thisContainer) is folder then set myFolder to name of thisContainer else if (the class of thisContainer) is account then set myAccount to name of thisContainer end if if myFolder is not null and myAccount is not null then exit repeat else set thisItem to thisContainer end if end repeat tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook myFolder tags myAccount set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myCreateDate end tell end repeat end tell Link to comment
Roy.az 0 Posted October 10, 2019 Share Posted October 10, 2019 Hello, I have few issues with the Import script on Mac. First, it doesn't import my attachments. But the most serious issue is that RTL (right-to-left) aligned notes I have on my Notes app are imported to Evernote aligned LTR.. If someone can help or have any idea I will appreciate it. Thanks! Roy Link to comment
Shauli 1 Posted October 10, 2019 Share Posted October 10, 2019 Roy.az call me I’ll help you 0547871787 Link to comment
Roy.az 0 Posted October 10, 2019 Share Posted October 10, 2019 5 hours ago, Shauli said: Roy.az call me I’ll help you 0547871787 Thanks, i'll do! Link to comment
Kruse 0 Posted January 17, 2020 Share Posted January 17, 2020 I tried the following script in Catalina and thought it worked since the note count was the same in both apps. However, it duplicates some of the notes to hit that number. I've tried adding single folders and multiple folders with same results. In the single folder selection, it takes the last notes I've modified in Notes and imports regardless of whether they existed in the folder I selected for import. Truthfully, why doesn't Evernote create a support article with a solution rather than having people discuss this for over 10 years (literally). Any feedback to why it won't work? Thank you. tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set myTitle to the name of thisMessage set myText to the body of thisMessage set myCreateDate to the creation date of thisMessage set myModDate to the modification date of thisMessage set thisItem to thisMessage set myAccount to null set myFolder to null repeat set thisContainer to the container of thisItem if (the class of thisContainer) is folder then set myFolder to name of thisContainer else if (the class of thisContainer) is account then set myAccount to name of thisContainer end if if myFolder is not null and myAccount is not null then exit repeat else set thisItem to thisContainer end if end repeat tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook myFolder tags myAccount set the HTML content of myNote to myText set the creation date of myNote to myCreateDate set the modification date of myNote to myCreateDate end tell end repeat end tell Link to comment
revq 0 Posted January 28, 2020 Share Posted January 28, 2020 Any progress on this? I cannot believe that there is no easy way to migrate Apple Notes to Evernote?!? I tried the script approaches above but I get errors like: error "„Notes“ hat einen Fehler erhalten: show id \"x-coredata://137C8659-8033-4414-B83B-B2202069CDB3/ICNote/p453\" kann nicht in Typ specifier umgewandelt werden." number -1700 from show id "x-coredata://137C8659-8033-4414-B83B-B2202069CDB3/ICNote/p453" to specifier Link to comment
Gordonbp 1 Posted January 20, 2021 Share Posted January 20, 2021 Hi. Tried the latest code on here on Big Sur but keep getting this error: Syntax Error Expected end of line but found application constant or consideration. 1 Link to comment
sauce 0 Posted March 26, 2021 Share Posted March 26, 2021 Arrived here via a blog post offering a solution to the migrate from Apple Notes to Evernote issue (https://medium.com/doraoutloud/migrating-your-apple-notes-to-evernote-12114418ba00) Tried the code listed on that post - which appears the same as the latest iteration of codes in this thread - but received the following error: "Syntax Error Expected expression, property or key form, etc. but found unknown token." My OS: Catalina Version 10.15.7 with Notes Version 4.7 (1111.23) I'm completely new to using Apple Script so am not yet comfortable tinkering with it & am hoping someone else here can help make the code run as intended on this newer OS! 🙏 Link to comment
Zain_Akbar 0 Posted June 27, 2022 Share Posted June 27, 2022 I read all of this an none of them works. Link to comment
Level 5 PinkElephant 6,254 Posted June 27, 2022 Level 5 Share Posted June 27, 2022 The new version does not allow scripting. Try to install legacy, and repeat the transfer. Maybe you need to alter the „Evernote“ application call, to grab the legacy client instead of the new one. https://help.evernote.com/hc/en-us/articles/360052560314-Install-an-older-version-of-Evernote Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now