chaver4u 2 Posted August 3, 2014 Share Posted August 3, 2014 How can I import my notes from Apples Notes App into Evernote? Link to post
Sentinel 195 Posted August 4, 2014 Share Posted August 4, 2014 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. Link to post
chaver4u 2 Posted August 4, 2014 Author Share Posted August 4, 2014 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. 1 Link to post
Solution BigRedling 8 Posted October 14, 2015 Solution Share Posted October 14, 2015 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 7 1 Link to post
Doyle 0 Posted December 7, 2015 Share Posted December 7, 2015 Thank you so much, BigRedling! Your script worked flawlessly! I can't believe how quick and seamless it was. So cool! Link to post
Willem Prins 0 Posted January 30, 2016 Share Posted January 30, 2016 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! Link to post
Level 5* JMichaelTX 4,065 Posted February 1, 2016 Level 5* Share Posted February 1, 2016 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 Link to post
mckenziek234 0 Posted March 27, 2016 Share Posted March 27, 2016 This worked a treat! Just wanted to say thank you to all who generated and refined the script. Link to post
TuttutMutt 0 Posted July 14, 2016 Share Posted July 14, 2016 Thanks @BigRedling. Worked perfectly! Link to post
jwar 0 Posted August 27, 2016 Share Posted August 27, 2016 Thank you - this worked perfectly! Link to post
finchy 0 Posted November 28, 2016 Share Posted November 28, 2016 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? Link to post
CMGill 0 Posted December 14, 2016 Share Posted December 14, 2016 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? Link to post
msyaeger 0 Posted March 2, 2017 Share Posted March 2, 2017 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). Link to post
jd007 0 Posted March 19, 2017 Share Posted March 19, 2017 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. Link to post
Level 5* DTLow 5,099 Posted March 19, 2017 Level 5* Share Posted March 19, 2017 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 .... Link to post
jd007 0 Posted March 19, 2017 Share Posted March 19, 2017 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? Link to post
Level 5* DTLow 5,099 Posted March 19, 2017 Level 5* Share Posted March 19, 2017 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 Link to post
jd007 0 Posted March 19, 2017 Share Posted March 19, 2017 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 Link to post
Level 5* DTLow 5,099 Posted March 19, 2017 Level 5* Share Posted March 19, 2017 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" Link to post
jd007 0 Posted March 19, 2017 Share Posted March 19, 2017 (edited) 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 March 19, 2017 by jd007 Link to post
jd007 0 Posted March 21, 2017 Share Posted March 21, 2017 @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") Link to post
Level 5* DTLow 5,099 Posted March 21, 2017 Level 5* Share Posted March 21, 2017 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 Link to post
jd007 0 Posted March 29, 2017 Share Posted March 29, 2017 @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 Link to post
Level 5* JMichaelTX 4,065 Posted March 29, 2017 Level 5* Share Posted March 29, 2017 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. Link to post
jd007 0 Posted March 29, 2017 Share Posted March 29, 2017 1 hour ago, JMichaelTX said: 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. Here you go: http://macscripter.net/viewtopic.php?id=45602 Link to post
Level 5* JMichaelTX 4,065 Posted March 29, 2017 Level 5* Share Posted March 29, 2017 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? Link to post
Level 5* DTLow 5,099 Posted March 30, 2017 Level 5* Share Posted March 30, 2017 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" Link to post
jd007 0 Posted March 30, 2017 Share Posted March 30, 2017 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. Link to post
jd007 0 Posted March 30, 2017 Share Posted March 30, 2017 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. Link to post
Level 5* DTLow 5,099 Posted March 30, 2017 Level 5* Share Posted March 30, 2017 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 Link to post
Level 5* JMichaelTX 4,065 Posted April 1, 2017 Level 5* Share Posted April 1, 2017 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. 1 Link to post
jd007 0 Posted April 2, 2017 Share Posted April 2, 2017 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? Link to post
Level 5* JMichaelTX 4,065 Posted April 3, 2017 Level 5* Share Posted April 3, 2017 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. Link to post
Serenity 0 Posted February 21, 2018 Share Posted February 21, 2018 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! Link to post
ROK&ROLL 3 Posted May 31, 2018 Share Posted May 31, 2018 On 2/1/2016 at 1:42 AM, JMichaelTX said: 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 To anyone who comes across this thread, (May 2018) I used the script above, posted and modified by the guys above. it 100% worked. Just imported 200 notes to Evernote in 40 seconds. Life saver. Thank you. 2 1 Link to post
ROK&ROLL 3 Posted July 19, 2019 Share Posted July 19, 2019 Bit of a Hail Mary, but is there any way to import notes from Apple Notes, to Evernote, and keep the notes organised in their original folders. Not all notes in a single Evernote Notebook I have hundreds of notes in about 20 different folders. Would like to keep them organised on import to Evernote. Thanks Link to post
Level 5* DTLow 5,099 Posted July 19, 2019 Level 5* Share Posted July 19, 2019 32 minutes ago, ROK&ROLL said: Bit of a Hail Mary, but is there any way to import notes from Apple Notes, to Evernote, and keep the notes organised in their original folders. Not all notes in a single Evernote Notebook I have hundreds of notes in about 20 different folders. Would like to keep them organised on import to Evernote. Yes, the script can be modified to retrieve the notes folder and assign an Evernote Notebook Something like set myfolder to container of thisMessage set the notebook of myNote to myfolder 1 Link to post
ROK&ROLL 3 Posted July 19, 2019 Share Posted July 19, 2019 Amazing, thank you. Is that under "tell Notes" or "tell Evernote" ? I'm very new to script. Would you mind posting the full script - with the additional "Folder" modification? Link to post
ROK&ROLL 3 Posted July 22, 2019 Share Posted July 22, 2019 It says the variable 'the message" is not defined. Any thoughts? Link to post
ROK&ROLL 3 Posted July 22, 2019 Share Posted July 22, 2019 Posted October 14, 2015 Thank you - script below. - tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set myfolder to container of thisMessage 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 notebook of myNote to myfolder set the creation date of myNote to myCreateDate set the modification date of myNote to myModDate end tell end repeat end tell Link to post
Level 5* DTLow 5,099 Posted July 24, 2019 Level 5* Share Posted July 24, 2019 On 7/22/2019 at 7:25 AM, ROK&ROLL said: script below. I got your script working with the following changes set myfolder to container of thisMessage change to set mycontainer to container of thisMessage set myfolder to name of mycontainer as string tell application "Evernote" added if (not (notebook named myfolder exists)) then create notebook myfolder set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["Imported from Notes"] change to set myNote to create note with text myTitle title myTitle notebook myfolder tags ["Imported from Notes"] set the notebook of myNote to myfolder omit - the notebook is set when the note is created Link to post
ROK&ROLL 3 Posted July 24, 2019 Share Posted July 24, 2019 Thank you working on this. With the changes you recommended. I get the error below. Syntax Error Expected end of line, etc. but found identifier. My full script with changes below - tell application "Notes" set theMessages to every note repeat with thisMessage in theMessages set mycontainer to container of thisMessage set myfolder to name of mycontainer as string 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" if (not (notebook named myfolder exists)) then create notebook myfolder set myNote to create note with text myTitle title myTitle notebook myfolder 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 Link to post
Level 5* DTLow 5,099 Posted July 24, 2019 Level 5* Share Posted July 24, 2019 9 minutes ago, ROK&ROLL said: Thank you working on this. With the changes you recommended. I get the error below. Syntax Error Expected end of line, etc. but found identifier. The error occurs on set myNote to create note with text myTitle title myTitle notebook myfolder tags ["Imported from Notes"] It looks valid, but there may be some hidden characters in your code I was able to clear the error by retyping with text Link to post
ROK&ROLL 3 Posted July 24, 2019 Share Posted July 24, 2019 Worked like a charm. Perfect, I honestly can't thank you enough. Just transferred close to 150 notes, all in their respective folders. Thank you!! Link to post
Level 5* DTLow 5,099 Posted July 24, 2019 Level 5* Share Posted July 24, 2019 You're welcome I hope you're not disenchanted with Applescript. It's a useful tool and I use many scripts to automate tasks in Evernote and other apps Link to post
Terell 3 Posted November 11, 2019 Share Posted November 11, 2019 Hey guys, Here's the version that works with OS X 10.15 Catalina and the latest Evernote. 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 repeat with i from 1 to (count chosenFolderNames) 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 j from 1 to (count theNotes) tell application "Notes" set myTitle to the name of note j set myText to the body of note j set myCreateDate to the creation date of note j set myModDate to the modification date of note j end tell tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook "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 repeat It doesn't save any attachments - you have to remove them from your notes first, otherwise the script won't run. But apart from that, it works just fine. Hope you find it useful 1 2 Link to post
SyberKnight 2 Posted November 14, 2019 Share Posted November 14, 2019 @Terell thank you for modifying/updating this little script for Catalina! i'm not a scripter but i do understand how to put it in the Script Editor, Compile it, & run it. when i do, it imports from "all iCloud" instead of the folder(s) i choose. oddly though, it does seem to be looking in to the folder i choose at least to gather the number of notes within that folder; then it imports that number of notes, just not from the chosen folder but from the main list. any suggestions/thoughts on this? thanks. Link to post
ColinK 1 Posted November 18, 2019 Share Posted November 18, 2019 Thanks for the new Catalina script! I get this error when I run it: "error "Notes got an error: AppleEvent handler failed." number -10000". Any ideas how to fix it? Link to post
SyberKnight 2 Posted November 18, 2019 Share Posted November 18, 2019 yes, REALLY hoping @Terell can/will help us out, or someone else who's knowledgable in Applescript very soon 🙂 Link to post
Level 5* DTLow 5,099 Posted November 18, 2019 Level 5* Share Posted November 18, 2019 8 hours ago, ColinK said: I get this error when I run it: "error "Notes got an error: AppleEvent handler failed." number -10000". Any ideas how to fix it? This is an Notes/Applescript issue; we're waiting for Apple to fix it Info at https://hookproductivity.com/help2/integration/hook-and-macos-10-15-catalina-notes-app/ Link to post
SyberKnight 2 Posted November 25, 2019 Share Posted November 25, 2019 still hoping to get a revision to @Terell script. i'm NOT getting any error messages, my issue is different (as described). if this is still a symptom of the hookproductivity bug description, then ok, but i have a sliver of hope still since Terell got it working. On 11/14/2019 at 3:16 PM, SyberKnight said: it imports from "all iCloud" instead of the folder(s) i choose. oddly though, it does seem to be looking in to the folder i choose at least to gather the number of notes within that folder; then it imports that number of notes, just not from the chosen folder but from the main list. Link to post
mbrannigan 0 Posted April 19, 2020 Share Posted April 19, 2020 GREAT. Worked without issue. Great to see some code that actually works - half the code posted is nonsense and never tested. Thanks Again. Now I can forget about trying to staddle the APPLE and android worlds as this usually craps out at some point. Apple Macs and Oppo Android phone Link to post
antkn33 0 Posted August 13, 2020 Share Posted August 13, 2020 On 11/10/2019 at 10:11 PM, Terell said: Hey guys, Here's the version that works with OS X 10.15 Catalina and the latest Evernote. 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 repeat with i from 1 to (count chosenFolderNames) 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 j from 1 to (count theNotes) tell application "Notes" set myTitle to the name of note j set myText to the body of note j set myCreateDate to the creation date of note j set myModDate to the modification date of note j end tell tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook "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 repeat It doesn't save any attachments - you have to remove them from your notes first, otherwise the script won't run. But apart from that, it works just fine. Hope you find it useful I get an error error "Notes got an error: AppleEvent handler failed." number -10000 On macOS 10.15.6 Any ideas thanks Link to post
Mike8471 2 Posted August 30, 2020 Share Posted August 30, 2020 Hey everyone, I couldn't get the script here to work, so decided to write a new one. I followed this very useful tutorial here to get started https://macmost.com/export-all-of-the-notes-on-your-mac-using-a-script.html The difference is, my script will let you choose which folder in Notes that you want to export (you can multi select) then it will create it as a Notebook in Evernote. This works on macOS Catalina 10.15.6. Follow the steps in the link above but use this code instead. Enjoy // set things up var app = Application.currentApplication(); app.includeStandardAdditions = true; var notesApp = Application('Notes'); notesApp.includeStandardAdditions = true; var enApp = Application('Evernote'); enApp.includeStandardAdditions = true; // choose which notes //var notes = notesApp.folders; var folders = notesApp.accounts.byName('iCloud').folders; var whichFolders = app.chooseFromList(folders.name(), { withPrompt: "Which Folders?", multipleSelectionsAllowed: true }); if (whichFolders) { // loop through all folders for(var i=0; i<folders.length; i++) { // is this folder one to be exported? if (whichFolders.indexOf(folders[i].name()) > -1) { var foldername = folders[i].name(); var notebook = enApp.createNotebook(foldername); // get notes in the folder var notes = folders[i].notes; for(var j=0; j<notes.length; j++) { var name = notes[j].name(); var html = notes[j].body(); var creationDate = notes[j].creationDate(); var modificationDate = notes[j].modificationDate(); var enNote = enApp.createNote({ title: name, withHtml:html, created: creationDate, notebook: notebook}); enNote.modificationDate = modificationDate; } } } } 1 Link to post
Mike8471 2 Posted September 3, 2020 Share Posted September 3, 2020 On 8/31/2020 at 11:10 PM, antkn33 said: Doesn't work for me. Care to elaborate? Link to post
ColinK 1 Posted September 3, 2020 Share Posted September 3, 2020 I get an Error -1728: Can't get object. Link to post
Anshuman 0 Posted September 8, 2020 Share Posted September 8, 2020 On 11/11/2019 at 11:11 AM, Terell said: Hey guys, Here's the version that works with OS X 10.15 Catalina and the latest Evernote. 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 repeat with i from 1 to (count chosenFolderNames) 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 j from 1 to (count theNotes) tell application "Notes" set myTitle to the name of note j set myText to the body of note j set myCreateDate to the creation date of note j set myModDate to the modification date of note j end tell tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook "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 repeat It doesn't save any attachments - you have to remove them from your notes first, otherwise the script won't run. But apart from that, it works just fine. Hope you find it useful Worked for me like charm on Catalina 10.15.4 Thanks a lot for this. Link to post
lillycorn 0 Posted September 16, 2020 Share Posted September 16, 2020 On 8/30/2020 at 7:44 PM, Mike8471 said: Hey everyone, I couldn't get the script here to work, so decided to write a new one. I followed this very useful tutorial here to get started https://macmost.com/export-all-of-the-notes-on-your-mac-using-a-script.html The difference is, my script will let you choose which folder in Notes that you want to export (you can multi select) then it will create it as a Notebook in Evernote. This works on macOS Catalina 10.15.6. Follow the steps in the link above but use this code instead. Enjoy // set things up var app = Application.currentApplication(); app.includeStandardAdditions = true; var notesApp = Application('Notes'); notesApp.includeStandardAdditions = true; var enApp = Application('Evernote'); enApp.includeStandardAdditions = true; // choose which notes //var notes = notesApp.folders; var folders = notesApp.accounts.byName('iCloud').folders; var whichFolders = app.chooseFromList(folders.name(), { withPrompt: "Which Folders?", multipleSelectionsAllowed: true }); if (whichFolders) { // loop through all folders for(var i=0; i<folders.length; i++) { // is this folder one to be exported? if (whichFolders.indexOf(folders[i].name()) > -1) { var foldername = folders[i].name(); var notebook = enApp.createNotebook(foldername); // get notes in the folder var notes = folders[i].notes; for(var j=0; j<notes.length; j++) { var name = notes[j].name(); var html = notes[j].body(); var creationDate = notes[j].creationDate(); var modificationDate = notes[j].modificationDate(); var enNote = enApp.createNote({ title: name, withHtml:html, created: creationDate, notebook: notebook}); enNote.modificationDate = modificationDate; } } } } Thank you so much! I was trying to do this for the last 5 days and your script worked like a charm! Link to post
MANÜL 0 Posted September 28, 2020 Share Posted September 28, 2020 On 9/3/2020 at 5:46 PM, ColinK said: I get an Error -1728: Can't get object. Unfortunately I'm getting the same error. Link to post
Everlast24 1 Posted October 30, 2020 Share Posted October 30, 2020 Hi All, is there a way to include the name of the note as a body in Evernote? I understand Evernote uses the first paragraph as the title and then excludes that from the body? I have some Apple notes such as below where the first paragraph is quite long. Picture 1 When this is moved to Evernote - only the first 15 words or so appear in Evernote title and the body of the note is empty Picture 2 I am okay with the title being truncated. I just need for the first paragraph to appear in the body in Evernote too. Many thanks in advance. Link to post
Level 5* DTLow 5,099 Posted October 30, 2020 Level 5* Share Posted October 30, 2020 1 hour ago, Everlast24 said: I understand Evernote uses the first paragraph as the title and then excludes that from the body? What method are you using to move your notes to Evernote? 1 Link to post
Everlast24 1 Posted October 30, 2020 Share Posted October 30, 2020 6 hours ago, DTLow said: What method are you using to move your notes to Evernote? Thanks DTLow. I have used the below version 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 Link to post
Level 5* DTLow 5,099 Posted October 30, 2020 Level 5* Share Posted October 30, 2020 3 minutes ago, Everlast24 said: I have used the below version You're using a script that copies the note title from Apple Notes title Why do you "understand Evernote uses the first paragraph as the title and then excludes that from the body?" 1 Link to post
Everlast24 1 Posted October 30, 2020 Share Posted October 30, 2020 19 minutes ago, DTLow said: You're using a script that copies the note title from Apple Notes title Why do you "understand Evernote uses the first paragraph as the title and then excludes that from the body?" Yes, apologies I realised I need to elaborate a bit more on this. Apple notes do not have a designated title field. I understand this code picks Apple's title (first paragraph) and turns it into an Evernote title. The issue is Apple's first paragraph not appearing anywhere else. This becomes a problem when that paragraph is too long and gets truncated as an Evernote title. So I wonder if it is possible to include that first paragraph also in Evernote's body of text? Apologies, if it still sounds confusing. Link to post
lov3likerockets 0 Posted October 31, 2020 Share Posted October 31, 2020 On 8/30/2020 at 3:44 PM, Mike8471 said: Hey everyone, I couldn't get the script here to work, so decided to write a new one. I followed this very useful tutorial here to get started https://macmost.com/export-all-of-the-notes-on-your-mac-using-a-script.html The difference is, my script will let you choose which folder in Notes that you want to export (you can multi select) then it will create it as a Notebook in Evernote. This works on macOS Catalina 10.15.6. Follow the steps in the link above but use this code instead. Enjoy // set things up var app = Application.currentApplication(); app.includeStandardAdditions = true; var notesApp = Application('Notes'); notesApp.includeStandardAdditions = true; var enApp = Application('Evernote'); enApp.includeStandardAdditions = true; // choose which notes //var notes = notesApp.folders; var folders = notesApp.accounts.byName('iCloud').folders; var whichFolders = app.chooseFromList(folders.name(), { withPrompt: "Which Folders?", multipleSelectionsAllowed: true }); if (whichFolders) { // loop through all folders for(var i=0; i<folders.length; i++) { // is this folder one to be exported? if (whichFolders.indexOf(folders[i].name()) > -1) { var foldername = folders[i].name(); var notebook = enApp.createNotebook(foldername); // get notes in the folder var notes = folders[i].notes; for(var j=0; j<notes.length; j++) { var name = notes[j].name(); var html = notes[j].body(); var creationDate = notes[j].creationDate(); var modificationDate = notes[j].modificationDate(); var enNote = enApp.createNote({ title: name, withHtml:html, created: creationDate, notebook: notebook}); enNote.modificationDate = modificationDate; } } } } This worked previously for me on 10.15.6, but I now get an error of: "Error -1708: Message not understood" on 10.15.7. Link to post
brightshadow1989 0 Posted November 8, 2020 Share Posted November 8, 2020 On 10/31/2020 at 1:17 AM, lov3likerockets said: This worked previously for me on 10.15.6, but I now get an error of: "Error -1708: Message not understood" on 10.15.7. Likewise. Has anybody found a solution yet? Link to post
Everlast24 1 Posted November 17, 2020 Share Posted November 17, 2020 On 10/30/2020 at 5:40 PM, Everlast24 said: Yes, apologies I realised I need to elaborate a bit more on this. Apple notes do not have a designated title field. I understand this code picks Apple's title (first paragraph) and turns it into an Evernote title. The issue is Apple's first paragraph not appearing anywhere else. This becomes a problem when that paragraph is too long and gets truncated as an Evernote title. So I wonder if it is possible to include that first paragraph also in Evernote's body of text? Apologies, if it still sounds confusing. @DTLowany suggestions how I could include the first paragraph also in the body of the text? Thanks in advance. Link to post
Level 5* DTLow 5,099 Posted November 24, 2020 Level 5* Share Posted November 24, 2020 On 11/17/2020 at 2:55 PM, Everlast24 said: @DTLowany suggestions how I could include the first paragraph also in the body of the text? When retrieving the contents of the Apple Note, all paragraphs are included in the body of the text No special processing is required to "include the first paragraph" Link to post
lov3likerockets 0 Posted November 30, 2020 Share Posted November 30, 2020 On 11/8/2020 at 7:47 AM, brightshadow1989 said: Likewise. Has anybody found a solution yet? @DTLowDo you have any suggestions here? I tried on a computer that is on 10.14.6 and experienced the same error, "Error -1708: Message not understood". So it seems to be related to an update to Evernote itself. Link to post
Level 5* DTLow 5,099 Posted November 30, 2020 Level 5* Share Posted November 30, 2020 31 minutes ago, lov3likerockets said: @DTLowDo you have any suggestions here? I tried on a computer that is on 10.14.6 and experienced the same error, "Error -1708: Message not understood". So it seems to be related to an update to Evernote itself. This script works tell application "Notes" set folderNames to name of folders of account "On My Mac" repeat with thisfolderName in folderNames set theNotes to notes of folder thisfolderName of account "On My Mac" tell account "On My Mac" tell folder thisfolderName repeat with j from 1 to (count theNotes) set theNote to note j set myTitle to get the name of note j set myText to get the body of note j set myCreateDate to the creation date of note j set myModDate to the modification date of note j tell application "Evernote" set myNote to create note with text myTitle title myTitle notebook "Imported --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 -- BUG FIX end tell end repeat end tell end tell end repeatend tell Link to post
Daniel Roy 0 Posted January 8 Share Posted January 8 I get the error: Syntax Error Expected end of line but found application constant or consideration. Then, it highlights the word note after the word create. I'm not experienced in applescript at all, so I am not sure what I'm missing. Am I supposed to just copy/paste your script there into automator or applescript and then hit run? Link to post
ypc 0 Posted January 11 Share Posted January 11 @Daniel Roy I had the same issue and solved the problem by installing Evernote Legacy. The current Evernote doesn't support apple script. (See the following post) Link to post
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