Jump to content
We recently experienced a login issue we believe we have resolved. You should now be able to login to the forums successfully! Read more... ×

Recommended Posts

Although I have not tried it yet, I found this:

 

http://jeremyrnelson.wordpress.com/2014/01/19/importing-apple-notes-into-evernote/

 

If you cannot get this to work, you can export each Apple Note as PDF documents then import into Evernote.  That can be done using an "Import Folder" as described here:  http://jeremyrnelson.wordpress.com/2014/01/19/importing-apple-notes-into-evernote/

 

In either case, using Applescript will probably be your best bet.  I hope this helps.

Share this post


Link to post

Thanks Sentinel.

Since I didn't have that many notes in my Notes.app, my son suggested to cut & paste the content of each note in Evernote. That worked out fine.

  • Like 1

Share this post


Link to post

Sentinel's link to the AppleScript worked great for me on El Capitan! I love how it even got the dates!

 

https://jeremyrnelson.wordpress.com/2014/01/19/importing-apple-notes-into-evernote/

 

However, there were a few changes I made to the script. I changed the smart quotes to straight quotes. I changed the "set the modification date of myNote to myCreateDate" to "set the modification date of myNote to myModDate". And I found all of the extra tags unnecessary, so I just used the tag "Imported from Notes" Also, Apple Script Editor is now called Script Editor, found in the Utilities folder.

 

Below is my modified script, tested and it worked! Just copy and paste into Script Editor and hit the Run button and watch the magic right before your eyes!

 

 

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"]
 
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 repeat
 
end tell
  • Like 6
  • Thanks 1

Share this post


Link to post

Thanks for those links Sentinel / Big Redling! Seamless indeed! 
Now I don't have to worry about looking in the wrong place for that one note.
I'm starting to like Apple Script Editor more and more. Though (as a front-end-developer) I still find the whole natural-language-syntax hard to get used to!

Share this post


Link to post

Just so everyone knows, the original author of this script referred to by Sentinel and Big Redling is @d.b.walker

See 

EDIT:  2016-03-28  15:32 CT -- Changed below code to make BUG fix, as identified by:

For easy reference, I have cleaned up the formatting issues caused by the new forum update, and provided here:

(*
====================================================
  [EN] Import Apple Notes into Evernote
====================================================

DATE:    2013-10-24
AUTHOR: d.b.walker

REVISED BY:  JMichaelTX on 2016-03-28 to make BUG fix

REF:
  • Importing from Apple Mail.app's Notes - Mac Help - Evernote User Forum       
  • https://discussion.evernote.com/topic/4046-importing-from-apple-mailapps-notes/?do=findComment&comment=236445

Posted 24 Oct 2013
Modified this script to work with Mavericks Notes, which is no longer in the mail app.
Added the original creation and modification dates
Added 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 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 BY JMichaelTX ##
      
    end tell
    
  end repeat
  
end tell

 

Share this post


Link to post

The problem with any of these, and I've seen this same script in about 10 different places  now, is that it doesn't handle attachments.  Is there no way to move the attachments in Notes.app over to Evernote?

Share this post


Link to post

I've found this script very useful in shifting about 1000 Notes notes, but I have encountered another problem:

If you have Notes notes with HTML code snippets in them (and I had quite a few) the HTML gets stripped out in the import process. Any way round this?

 

Share this post


Link to post

How come, instead of importing, we actually create a way to mirror and/handoff Apple Notes with Evernote?

If Evernote could view my Apple Notes, and if Apple Notes could accept my changes made within Evernote, then I would renew my Premium Subscription.  Notes does what I need, but Evernote has many more appreciable features that are worth the Premium price, IF AND ONLY if the two formats can sync with one another.  Otherwise, I risk duplicating my efforts by keeping two separate formatting programs.  (Just as 2Do syncs with Apple Reminders).  

(I work at an office whose IT team blocks Evernote from our network...but I am allowed to access iCloud.com, which of course contains Apple Notes).  It would be nice to do my work (at the office) in Notes, and see the sync on my home Mac, so as to utilize the full functionality from home with reminders, lists, etc).

Share this post


Link to post
On 11/29/2016 at 7:46 AM, finchy said:

The problem with any of these, and I've seen this same script in about 10 different places  now, is that it doesn't handle attachments.  Is there no way to move the attachments in Notes.app over to Evernote?

yep, this.

Share this post


Link to post
On 2017-03-19 at 7:47 AM, jd007 said:

yep, this.(Is there no way to move the attachments in Notes.app over to Evernote?)

Just a quick look at the above script.  
It can be modified on the Apple Notes side to save the attachments from the Apple Note
save .... in .....    edited: problems are being reported with saving attachments
On the Evernote side, the attachments can be imported
append ..... attachment ....

Share this post


Link to post
1 minute ago, DTLow said:

Just a quick look at the above script.  
It can be modified on the Apple Notes side to save the attachments from the Apple Note
On the Evernote side, the attachments can be imported
 

Really? Wow.. might give it a go, but don't want to test with all my Notes notes.. is there a way to modify so that it only uses a particular folder of notes, for example? 

Share this post


Link to post
On 2017-03-19 at 7:57 AM, jd007 said:

Really? Wow.. might give it a go, but don't want to test with all my Notes notes.. is there a way to modify so that it only uses a particular folder of notes, for example? 

The script currently runs with:   set theMessages to every note
I haven't tested this but you should be able to:   set theMessages to selection

edited: I haven't followed up on this but there's a report that Selection is not valid for Apple Notes

Share this post


Link to post
19 minutes ago, DTLow said:

The script currently runs with:   set theMessages to every note
I haven't tested this but you should be able to:   set theMessages to selection

tried this, got:   error "Notes got an error: Can’t get selection." number -1728 from selection

Share this post


Link to post
21 minutes ago, jd007 said:

tried this, got:   error "Notes got an error: Can’t get selection." number -1728 from selection

I don't want to take the time to debug this
How about limiting the note selection, as in 

set theMessages to every note whose name contains "Testing"

Share this post


Link to post
6 minutes ago, DTLow said:

I don't want to take the time to debug this
How about limiting the note selection, as in 

set theMessages to every note whose name contains "Testing"

Appreciate you don't want to debug. As for your suggestion, that's not going to work in the long run for me to select a folder of notes to export, as I would have to separately enter name of each note. (I just want to avoid exporting all notes, so trying to work out a way to do it with a selection or a folder.)

I did use it to test one note though, got as far as the attachment line. (save att in attFile)

error "The variable att is not defined." number -2753 from "att"

Edited by jd007

Share this post


Link to post

@DTLow, do you have any suggestions for resources/places where I can learn about these Applescript commands, particularly regarding Notes.app, so I can debug this and figure it out myself? I'm a newbie to scripting but would like to learn how to do this. Thanks.

I'm wondering if this particular one doesn't work since Apple changed Notes from being hosted by an email account, to iCloud. (The script refers to "theMessages")

 

Share this post


Link to post
1 hour ago, jd007 said:

do you have any suggestions for resources/places where I can learn about these Applescript commands, particularly regarding Notes.app, so I can debug this and figure it out myself? I'm a newbie to scripting but would like to learn how to do this

I learn best from existing scripts like the one posted above

This reference might help https://www.macosxautomation.com/applescript/notes/index.html It describes scripting the Notes app, and the dictionaries in the script editor

>>I just want to avoid exporting all notes, so trying to work out a way to do it with a selection or a folder.

Still checking the Selection thing; I found this on Folder

tell application "Notes"
    set myFolder to first folder whose name = "FolderA"
    set myNotes to notes of myFolder
    repeat with theNote in myNotes
        -- insert your code here
    end repeat
end tell

Share this post


Link to post

@DTLow, I posted the original script above on MacScripter forum to ask for help there. Nigel Garvey came up with the following, which works to get notes exported from Notes app and into Evernote, from a selected folder, however the attachments aren't coming across yet. (They are being saved in folders). The guys on that forum don't have Evernote so can't test that part of it. Can you take a quick look and see what you think might be at fault in the Evernote section? Evernote creates the note, it knows there should be an attachment there as it shows the box with question mark icon, it just doesn't attach it.

 

(*

    ====================================================

      [EN] Import Apple Notes into Evernote

    ====================================================

    

    DATE:    2013-10-24

    AUTHOR: d.b.walker

    

    REVISED BY:  JMichaelTX on 2016-03-28 to make BUG fix. <https://discussion.evernote.com/topic/64814-apple-notes-app/#comment-395941>

    

    REF:

      • Importing from Apple Mail.app's Notes - Mac Help - Evernote User Forum       

      • https://discussion.evernote.com/topic/4046-importing-from-apple-mailapps-notes/?do=findComment&comment=236445

    

    Posted 24 Oct 2013

    Modified this script to work with Mavericks Notes, which is no longer in the mail app.

    Added the original creation and modification dates

    Added multiple tags - replace with your own

    Did not add the long note name fix (I needed to preserve my note names)

    ====================================================

    

    FURTHER DEVELOPED BY: Nigel Garvey 2017-03-21/22/23, based on information in the Evernote fora, to allow a choice of Notes source folder(s) and to handle attachments.

    

    CAVEATS:

        1. I don't have Evernote and can't test that part of the code.

        2. (No longer relevant. Thanks to Yvan Koenig for the fix.)

        3. Any attachments are simply "appended" to the Evernote notes in the order they happen to be returned by Notes.

        4. The effect in Evernote of Notes's references to the attachments in the note HTML is unknown.

*)

 

main()

 

on main()

    -- User choice of one or more Notes folders (by name).

    tell application "Notes"

        activate

        set folderNames to name of folders

        set chosenFolderNames to (choose from list folderNames with multiple selections allowed)

        if (chosenFolderNames is false) then error number -128 -- Cancel button.

    end tell

    

    -- Preset HFS and POSIX versions of a path to a folder on the desktop for storing any attachments.

    set tempFolderPath to (path to desktop as text) & "Attachments from Notes:"

    set tempFolderPosix to quoted form of POSIX path of tempFolderPath

    

    -- Repeat with each chosen folder name:

    repeat with i from 1 to (count chosenFolderNames)

        -- Get all the notes in the folder with this name.

        set thisFolderName to item i of chosenFolderNames

        tell application "Notes" to set theNotes to notes of folder thisFolderName

        set quotedFolderName to quoted form of thisFolderName

        

        -- Repeat with each note in the folder:

        repeat with j from 1 to (count theNotes)

            set thisNote to item j of theNotes

            

            tell application "Notes"

                -- Get the relevant note data.

                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 myAttachments to the attachments of thisNote

                

                -- Any attachments will need to be extracted to the folder on the desktop and attached to the Evernote note from there.

                -- To preserve the attachment names and avoid confusion in the case of duplicated names, each attachment is saved to a separate subfolder in a hierarchy based on the folder/note/attachment structure. 

                set attachmentFiles to {}

                set attachmentCount to (count myAttachments)

                if (attachmentCount > 0) then

                    -- If this note has any attachments, create or add to the hierarchy of the folder on the desktop to accommodate each one.

                    do shell script ("mkdir -p " & tempFolderPosix & quotedFolderName & "/'Note '" & j & "/'Attachment '{1.." & attachmentCount & "}")

                    

                    -- Repeat with each attachment:

                    repeat with k from 1 to attachmentCount

                        set thisAttachment to item k of myAttachments

                        -- Put together a specifier for a file in which to save this attachment.

                        set thisFile to (tempFolderPath & thisFolderName & ":Note " & j & ":Attachment " & k & ":" & thisAttachment's name) as «class furl»

                        -- Create the file before trying to save to it. (Suggested by Yvan Koenig.)

                        close access (open for access thisFile)

                        -- Save the attachment to it.

                        save thisAttachment in thisFile -- Now it works! Thanks, Yvan!

                        -- Store the file specifier for the retrieval of the attachment below.

                        set end of attachmentFiles to thisFile

                    end repeat

                    

                end if

            end tell

            

            tell application "Evernote"

                

                set myNote to create note with text myTitle title myTitle notebook "Imported From Notes" tags ["imported_from_notes"]

                set the HTML content of myNote to myText

                

                repeat with thisFile in attachmentFiles

                    tell myNote to append attachment thisFile

                end repeat

                

                set the creation date of myNote to myCreateDate

                set the modification date of myNote to myModDate

                

            end tell

            

        end repeat

        

    end repeat

end main

 

 

Share this post


Link to post
4 hours ago, jd007 said:

Nigel Garvey came up with the following, which works to get notes exported from Notes app and into Evernote, from a selected folder, however the attachments aren't coming across yet.

Please post the link to MacScripter.net post where the script is located.  Sometimes copy/paste of a script into a forum like this one can present problems.

 

Share this post


Link to post
14 hours ago, jd007 said:

I posted the original script above on MacScripter forum to ask for help there. Nigel Garvey came up with the following, which works to get notes exported from Notes app and into Evernote, from a selected folder, however the attachments aren't coming across yet. (They are being saved in folders).

So, can you see the attachment files from the Notes app in folders on your Mac?
If so, can you successfully attach these files to an EN Note manually?
Are you getting any errors from the Script?

Share this post


Link to post
On 2017-03-28 at 7:00 PM, jd007 said:

however the attachments aren't coming across yet. (They are being saved in folders)

I'm looking into this now
It looks like the attachments are not being saved from Notes - the script just creates an empty file
In Evernote, the empty file gets added as an attachment, hence "the box with question mark icon"

Share this post


Link to post
17 hours ago, JMichaelTX said:

So, can you see the attachment files from the Notes app in folders on your Mac?
If so, can you successfully attach these files to an EN Note manually?
Are you getting any errors from the Script?

Wow, I thought the attachment files were being successfully saved, I had looked and seen them there.. but just now I actually tried to view one of them, and there isn't actually a file there.. just an icon that is zero bytes.

No, no errors from the script.

Share this post


Link to post
4 hours ago, DTLow said:

I'm looking into this now
It looks like the attachments are not being saved from Notes - the script just creates an empty file
In Evernote, the empty file gets added as an attachment, hence "the box with question mark icon"

Yes, it is an empty file.

Share this post


Link to post
4 hours ago, jd007 said:

Wow, I thought the attachment files were being successfully saved, I had looked and seen them there.. but just now I actually tried to view one of them, and there isn't actually a file there.. just an icon that is zero bytes.

ok - we can focus on the issue of the "save thisAttachment in thisFile" not working

Also, this is overly complex, saving the entire set of attachments and then importing them
The statement  "set myAttachments to the attachments of thisNote" is sufficient
When creating the Evernote Note, pass through the myAttachments list and work on each attachment individually

Share this post


Link to post
On 3/28/2017 at 9:00 PM, jd007 said:

I posted the original script above on MacScripter forum to ask for help there. Nigel Garvey came up with the following, which works to get notes exported from Notes app and into Evernote, from a selected folder, however the attachments aren't coming across yet.

Based on the discussion at  http://macscripter.net/viewtopic.php?id=45602 , it looks like this is a macOS Sierra bug, with no workarounds for now.  Sorry, I can't test or explore solutions since I'm still running macOS El Capitan 10.11.6.

  • Like 1

Share this post


Link to post
15 hours ago, JMichaelTX said:

Based on the discussion at  http://macscripter.net/viewtopic.php?id=45602 , it looks like this is a macOS Sierra bug, with no workarounds for now.  Sorry, I can't test or explore solutions since I'm still running macOS El Capitan 10.11.6.

I'm running El Capitan too. So why would the bug occur in El Cap if it's a Sierra bug?

Share this post


Link to post
13 hours ago, jd007 said:

I'm running El Capitan too. So why would the bug occur in El Cap if it's a Sierra bug?

Perhaps I misunderstood the MacScripter.net discussion.  I don't normally use Apple Notes, but when I get a chance I'll try to do some testing.

The first test needs to be just Apple Notes.  Can you, via AppleScript, save a Note's attachments to a file.

Share this post


Link to post
On 1/31/2016 at 5:42 PM, JMichaelTX said:

 

Thanks to you JMichaelTX, d.b.walker, Big Redling and everyone who contributed to this script. Here we are in 2018, I'm using MacOS High Sierra, and the script worked perfectly. I was dreading the thought of having to copy/paste all of my Notes into Evernote. Hooray for scripters!

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×