I have a project that is well over my head. I am looking to pay for someones time to help me export Apple Notes to an external folder. I have over 7,000 notes in about 20 different folders, it totals about 15 GB of data. I would like to export one apple notes folder at a time so I can keep the content in its corresponding folder. The notes themselves have varying content. Some have only attachments PDF, MP3, JPG, XLS, etc. Some contain text notes. I don’t use tagging, but would like to keep the current file name and if possible creation date.
This video gives a similar example but as it stands will not handle items that are not text notes, i.e. any type of attachment with in the Apple Note… https://www.youtube.com/watch?v=OPHauFjIi0U
If this is something of interest, please contact me. We can discuss details.
I just looked a bit into this, but did not find a solution.
Closest thing was this page: http://macscripter.net/viewtopic.php?id=45602
It seems to describe how to export to Evernote.
Maybe some of the AppleScript gurus on the forum can use this information to make write a script which saves to the filesystem instead of Evernote.
Hi and Thank you for the input. If that one crashes unless you are running Sierra 10.10. Too bad too, as it would have been a great work around. EN has a decent export, so I could use that to achieve the objective.
Saving the attachments to file via AppleScript failed (probably due to a bug in Note's AS support).
Getting the attachment files via ID also failed.
I played around with parts of the scripts on 10.13 and also failed to save the attachments to file.
Notes.app can export to PDF. I think, this could be automized via clumsy GUI scripting. But I guess what you want is exporting each note to a folder, containing the note body as html and the attachments as separate files, right?
As the other posters have noted, I don't think it is possible to export attachments in Notes under macOS 10.11+. But it does appear to be possible with 10.10 (Yosemite). See More Discussion below.
Possible Solution
(totally untested)
While I was typing the text in More Discussion below, my feeble brain was working in the background, and came up with this idea, which looks very promising. So I have moved it to the top of my reply. If you don't like this idea and/or you want to see more discussion about other ideas, see More Discussion below.
Basis for Solution
If you open the Notes Attachment Browser, you can see all attachments
And, you can select all of them with ⌘A
And, most importantly, there is a Save Attachments menu item when you right-click on the selection:
.
I tried it and it works fine. saving all attachments to the same folder.
Export the text of all Notes as html, each in its own folder
Save the Note Title, Folder, and Attachment Names (if any) into a list
Manually save all attachments as shown above to one folder
Run another script that uses the list from #1 to move the attachments from the attachments folder (from #2) to the proper Note folder.
Run another script which imports the Notes from their export folder into Evernote.
This is ONLY an untested idea. There could be parts that don't work -- I don't know. But, in concept, it looks doable.
This will take quite a bit of effort to develop, and if you hire someone, it won't be cheap.
Good luck, and let us know how it goes.
### More Discussion
(unrelated to the above)
As the other posters have noted, **I don't think it is possible to export attachments in Notes under macOS 10.11+**. But it does appear to be possible with 10.10 (Yosemite).
> Topic Title: Export selected notes from Notes.app w/ attachments, import to EN
> URL: http://macscripter.netviewtopic.php?pid=189618#p189618
> Date: 2017-04-03
> Author: Yvan Koenig
> **I was able to save attachments under 10.9.5 and 10.10.5.**
> I tried under 10.11.6 with the folder on the desktop and with the folder in Containers:com.apple.notes.
> In both cases it failed.
So, with thousands of Notes to export, I'm sorry to say that the only possible solution I see is to copy all of your Notes to a Yosemite system, and do the export there. Frankly, I don't even know if that is possible, since the Notes structure changed in El Capitan.
I thought maybe some type of UI scripting could be used, but Notes really goes out of its way to prevent export of attachments. In fact, in the Notes UI there is NOT an attachment export menu item, even when you right-click on an attachment:
<img src="/uploads/default/original/2X/7/75e926952708fc3f012be61c029a0e368eef40d6.png" width="388" height="345">
The only crazy, untested idea I have to do any automation, is to semi-automate the process, but it still requires you to manually open each Note, and manually select the attachment. Once the attachment is selected, a script could copy the attachment, get the Note Title and folder, and then save to a file using Finder, creating the folders is needed.
Another thought just hit me: Have you posted the question of "How to Export Notes Attachments" on the [Apple discussions](https://discussions.apple.com/welcome) board? Most of the time I don't find the responses there very helpful, but sometimes you get lucky.
(So sorry to crosspost) Anyone found a way to do the export from Notes to rtf/rtfd? As an aside, Exporter on the Mac Apple Store will export all notes as HTML, so graphics are included.
The problem I'm trying to solve via rtf/rtfd is to import those into EagleFiler so I can maintain notes in something other than the default Apple Notes app. Love, love, love EagleFiler!
If you don't want styles at all, you can use AppleScript to grab the plain text of a Note. If you want formatting preserved you should be able to script an HTML export followed by HTML->rtf conversion using textutil.
If you describe what you want to do (eg do you have images that you want included? All Notes or just the currently open one? How does EagleFiler handle note titles? Are file names important in the import process? Etc...) I'm sure the KM hive-mind can come up with something!
@Nige_S, oh, but plain text won't work. I have lots of Notes with graphics, hence needing rtfd.
I want to export all 1200 notes; in their folders; Eaglefiler does great with importing titles; because I quit Evernote some years ago, the Notes that were there, exported as .enex are imported into Eaglefiler easily and with all graphics, etc. So, for notes that are more or less without graphics, rtf maintains things like colored text, something Bear (another macro here on KMF) doesn't maintain since Markdown doesn't do colored text. rtfd (which is how Eaglefiler imports enex with graphics) comes into Eaglefiler looking just as it did in Evernote. The problem from the get go is Apple Notes has no internal way of exporting all notes. Individual notes as PDF, yes, but not everything, editable as enex (which is how the Notes got into Notes). Hope this helps!
So, after a quick play -- Notes's export features are... limited, to say the least! Even grabbing the HTML via AppleScript doesn't help because it doesn't include images, which you need. And PDF export would have to be done one at a time via the GUI, so you may as well use the GUI and EagleFiler's Import. Good news is that this should be easily doable with KM.
The easiest workflow appears to be:
Open EagleFiler
Open Notes and select your first Note
Then run your KM macro which would:
Repeat numberOfNotes times (you could probably find a better stop condition!)
In Notes, select "Float selected Notes" from the "Window" menu
Keypress ⌘-A to select all
Keypress ⌘-! (or whatever you've set EagleFiler's "EagleFiler: Import" command to, if you've changed it)
Keypress ⌘-Tab or a KM action to bring Notes back to being the frontmost app
Keypress ⌘-W to close the floating window
Keypress ↓ to select the next Note
Put up a dialog to say you're done, then check EagleFiler's error pane for problems!
Exact details will depend on how you have Notes (folders?) and EagleFiler (libraries, tags? Never used it!) set up -- but if you import everything into an "Imported" library it'll be easy to tweak things afterwards. And you'll probably need some pauses in the workflow -- big Notes may need a delay after steps 1, 2, and 3 so KM doesn't run ahead of the action.
That should be enough to get you going, but shout out if anything isn't obvious. I'll see if I can whip up a demo macro later...
@Nige_S I'm afraid I'm not much of a programmer so I'm gonna need a bunch o' help on this. I very much appreciate the suggestions, and, I have no idea where to start. Do I just look for commands based on what you've listed? Help!
Those are KM commands, but to save you time there's a macro below. It has lots of one-second pauses so you can see what's going on, and only repeats 27 times because that's all the Notes I have! You might want to batches of, say, 100 so that of there's an error you just repeat the last batch instead of all previous imports.
All I did was make a new Library in EagleFiler, switch to Notes, make sure the first Note in the list was selected, then ran the macro and left everything alone. Coped fine even on my old iMac, but even if you leave the pauses as they are it'll only take a couple of hours to move all your Notes -- a couple of hours you can spend doing something more fun!
I'm sure there are improvements to be made to the macro, I'm a newbie to this myself, but for a one-off job "good enough" is often good enough...
@Nige_S I don't know if it's me being on an M1 with 12.4, Eaglefiler 1.9.7 and Notes 4.9 (from Monterey) but it's doing 10 notes, then closing the Eaglefiler window and stopping after 10 notes.
I'm going to look at this, and the one on the forum for importing to Bear (which is useless for text in Notes that's been colored) and see if I can combine the two somehow to make this work in Eaglefiler.
One of the other things I need to think about is how to preserve folders in Notes. It might just be to select a folder in both Notes and Eaglefiler and do the float, copy, paste from each folder. I think that's how the Bear KM macro works. I have just 38 folders with just under 1200 Notes. So, doing this 38 times as opposed to 1200 seems far easier.
It might just be that your 10th Note is bigger and/or takes longer to import? You'll see the macro does the import (which brings EagleFiler to the front), then waits a second and tabs back to Notes, then waits a second and closes the floating window. I can see that a slow response might mean the tab back doesn't happen so the "close" command hits EagleFiler instead.
Try this version, which uses a KM command rather than a simulated keystroke to bring Notes back to the front and pauses until it is at the front before closing the floating window:
@Nige_S Gosh, you have no idea how much I appreciate your help.
This time it got thru 7 records. The 7th has lots of graphics so something's stopping the macro there. But, at least the Eaglefiler library stayed open when the macro quit.
When I ran the Bear KM macro, I hit a bunch of errors as well. I guess I have some complex notes in Notes. It's one of the reasons I'm trying to move away. Sometimes the sync between devices for Notes can seem like an eternity. OTOH, finding a really good rtfd editor on iOS/iPadOS is also a challenge.
Knowing that ultimately there's a solution is very encouraging. I'm dissecting what your macro does and what the Bear macro does. I think by combining the two (one of the key points yours brings to the table is doing the float) the solution will ultimately surface.
This is kinda how I used to write Applescripts. I'd start, get help on macscripter.net then come to completion on my script. Once I have a working version, I'm gonna post it here!
@Nige_S OK, I have a silly question. Nowhere in your Macro is Eaglefiler called by name (activate Eaglefiler for example). So how does the macro know it applies to Eaglefiler?
EagleFiler registers a system-wide shortcut of ⌘-! that both activates it and does the import of whatever was selected -- it's that keystroke action in the macro that does the work, no need to "apply" the macro to EagleFiler at all. But because that keystroke also brings EagleFiler to the front we then have to switch back to Notes to do the next Note.
(I'm guessing it's the fact that we have an implicit switch to EagleFiler with the keystroke action but an explicit switch to Notes via an action that's causing you some confusion.)