Closed kepano closed 1 year ago
Make sure to check out https://github.com/threeplanetssoftware/apple_cloud_notes_parser
I have been developing & maintaining Exporter for the past 7 years. Just started using Obsidian & loving it. If there are any special requirements needed for Obsidian that aren't being met with the current version of Exporter, please do let me know.
@Star-Lord-XIII have you investigated the new iOS17 format for internal links? It would be great to make sure those links are maintained via [[Link]]
syntax once that feature becomes widely available.
Also can you confirm that Exporter's current Markdown export supports all attachment types (images, PDFs, etc), as well as advanced Markdown features like tables?
I haven't investigated the new link format, will look into it.
Exporter's current Markdown supports almost all these formats for attachments & renders tables correctly in markdown. Images shared from iOS in HEIC & HEIF formats are converted to jpegs while exporting in markdown; they are present in the HTML exports as well but in original (HEIC/F formats). These image formats are not currently imported/supported correctly by most note taking apps, including Obsidian. One exception with attachments is scans made from iOS devices. A workaround for that is to convert them manually into PDFs and reattach them to the note, which should work since PDF attachments are supported. I haven't found a better solution for this one yet as Apple Notes APIs don't expose scans from existing endpoints.
Your app worked wonderfully for me @Star-Lord-XIII - Many thanks!
A $2,500 bounty has been added to this project.
MacOS 13.5 doesn't expose iOS 17 internal links via attachments or body content. So there is no way to access those yet as far as I have tested. Same goes for todo lists. All other requirements mentioned in bug -- images, attachments, tables and Obsidian-compatible markdown are already supported by Exporter.
@Star-Lord-XIII this issue is for adding support within the Importer plugin, without the need for a separate tool
Acknowledged.
I have been developing & maintaining Exporter for the past 7 years. Just started using Obsidian & loving it. If there are any special requirements needed for Obsidian that aren't being met with the current version of Exporter, please do let me know.
@Star-Lord-XIII Your tool is almost perfect and the best I found for exporting Apple Notes. There is one little thing, although an important one, that does not seem to work: export of links (see attached Screenshot of an export to Markdown). Other exporters experience the same issue, therefore I wonder if this is due to limitation of the source data.
@holtwick
@Star-Lord-XIII Your tool is almost perfect and the best I found for exporting Apple Notes. There is one little thing, although an important one, that does not seem to work: export of links (see attached Screenshot of an export to Markdown). Other exporters experience the same issue, therefore I wonder if this is due to limitation of the source data.
I can't get Apple Notes to send coherent links as any easy share (I'm sure there is a way, but it's above my coding experience; I came over here to see if someone had snagged this bounty) to ANY other format, even directly from the native "Share to..." on my iPhone or iPad, especially if they are or have ever shown up as rich links. That may be part of the issue. I can see that they're not rich links here, but if it's ever converted into the preview format and you had to hit backspace or x out, it may still need kid gloves.
(A HUGE pain when using Notes as a quick bookmarking system and then trying to send it to yourself on a product where you can't pull up iCloud. Most things print them as text only like the first highlighted one. Again, I'm sure there is a workaround but Notes is frankly terrible for link lists.)
I would like to apply for this if possible - this seems like a fun thing to complete.
I have developed the Obsidian Homepage plugin, which is the 30th most popular in the community plugin repository. Additionally, I used to use Apple Notes as my primary note-taking solution and still use it for a few small things (though I use Obsidian for anything substantial), so I'm well-acquainted with what users expect and to test the correctness of any solution that would be developed.
I have examined the Importer code and have already developed a basic proof-of concept AppleNotesImporter
that takes the Apple Notes database and decodes the note files, and intend to complete it and create a full-featured solution if this is accepted.
NoteStore
SQLite database, which is stored in a designated location on the user's computer. This requires Obsidian to have the Full Disk Access permission on macOS, so it would prompt the user to ensure it is enabled if they don't have it (if their vault isn't in a location that requires it). Unfortunately AFAIK there is no way around this.It would be nice to see requirement for tags for importer.
I have been developing & maintaining Exporter for the past 7 years. Just started using Obsidian & loving it. If there are any special requirements needed for Obsidian that aren't being met with the current version of Exporter, please do let me know.
@Star-Lord-XIII Your tool is almost perfect and the best I found for exporting Apple Notes. There is one little thing, although an important one, that does not seem to work: export of links (see attached Screenshot of an export to Markdown). Other exporters experience the same issue, therefore I wonder if this is due to limitation of the source data.
Yeah, source is the cause of missing links and todo-list status. Unless the data is either present in the HTML body of the note or in the attachment list it cannot be exported by a sandboxed app which needs to follow the entitlement constraints to publish the app on AppStore. With links and todo lists I hope the Obsidian Importer will have an easier time since it will be outside AppStore and can have direct access to the Note's SQLite instance.
I have been developing & maintaining Exporter for the past 7 years. Just started using Obsidian & loving it. If there are any special requirements needed for Obsidian that aren't being met with the current version of Exporter, please do let me know.
Huge fan of Exporter! 🙇♂️ Thanks for your work on that.
Hi there, I'd like to apply for this.
My approach doesn't ask users to grant full disk access, which I think is a bit invasive. The main point of a built-in importer is to make things easier for non-tech people, so this might put them off a bit.
It's based on Apple JXA (JavaScript for Automation) and written in TypeScript. This PR shows how my approach works.
If this gets picked, I can work on it more to fix and iron out the bugs.
Thank you.
would be great to support export as pdf for handwritten notes!
@neo773 The way I see it, your solution has a different set of trade-offs but I wouldn't explicitly call it better.
Again, I see trade-offs inherent to both approaches, and I trust Obsidian's developers to make the right judgement. While the bounty is nice I think they should go with whatever is the most technically sound solution, not the one that happens to benefit me the most. Given that Apple pretty strictly sandboxes its apps I don't think there's going to be a solution without some sacrifices but if someone comes up with one I'd be impressed.
@mirnovov
Thanks for insights appreciate it!
it tells me "Notes account not found" despite my account being extant and having plenty of notes.
My PR was WIP so the account not showing up bug can be fixed, the current implementation is hardcoded that's why you can't see your folder.
Not sure about having to prompt to export then select which notes to import,
It's also doable, see 1st point.
It wouldn't surprise me if the HTML export in Sonoma just strips them;
I haven't upgraded my mac yet will test it soon.
Your solution massively increases the Importer JS output size to 21.3 MB
Seeing 3.4 MB on my end when building for production, it's the 2md
library that's caused it to balloon
This was quickly put together so the lib can be swapped with the builtin parser.
Also it was not my intention to go around Obsidian bounty rules (with the PR), I've been doing open source bounties listed on Algora.io which works a bit differently. So, I'm sorry about that.
!()[image.png]
and placed in the user's defined attachment location (Settings → File & links)Does not need to use Obsidian Importer.
End users will have free range to manipulate the shortcut according to their needs.
Can import/export single Apple Notes or multiple Apple Notes.
Obsidian users can create custom shortcut links and custom params to fire their shortcut using this format: shortcuts://run-shortcut?name=[name]&input=[input]&text=[text]
.
Is a true mobile and macOS solution! - A solution I am invested in.
AFAIK you can't grab videos/markup in bulk on mobile unless the user individually selects the video/markup and shares it. It does however, leave the file name which can then be parsed and found when the user logs into a macOS system.
Mobile users will have to install the shortcuts app.
Is an external tool outside of Obsidian.
!()[image.png]
and placed in the user's defined attachment location (Settings → File & links)Internal IOS17 links with the same name as the link are currently not supported in macOS 13 or even when copying text to the clipboard. The potential solution here would be to match the exact text with existing note names and parse accordingly. Even then, the user would need to manually approve these changes as some title names may appear as regular text in subsequent documents.
Easy way to access all Apple Note data all at once.
Great for if an Obsidian user keeps NoteStore.sqlite files in a external hard drive and needs to import them.
Great for if an Obsidian user needs to recover NoteStore.sqlite data.
You will need to have an intermediate to advanced level of SQL knowledge to understand, navigate and integrate this logic.
Apple can at any time choose to change their note storage structure as they have many times in the past.
This is my least researched and experimented solution. I have reliably retrieved basic Apple Note data using this method. However, I would happily work with or pass off this integration to mirnovov as mirnovov seems to know more about this.
!()[image.png]
and placed in the user's defined attachment location (Settings → File & links)Ideally, all of the solutions should be integrated for an inclusive solution. In my professional opinion, I would integrate in this order:
Also, I have a ton of Apple Notes and I need them properly imported lol...
I hope at least some of this information was useful to any current or future developers looking at this.
Let's build something great!
@mirnovov, a couple of questions we'd like to verify about your approach:
Thank you
x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles
(you can test it yourself by using the open
command in the shell). There would be an Obsidian prompt beforehand that would explain to the user what to do.@mirnovov you have been assigned the bounty! Please submit your initial PR by end of day (GMT) on October 16th, 2023.
Join the #plugin-dev/importer channel if you have any questions: https://discord.gg/obsidianmd
Thank you @neo773 and @BrandanTD for your very thoughtful submissions. This is a situation where all of the options have significant tradeoffs. We have decided to pursue the SQLite approach despite its downsides. We may ultimately need to explore the AppleScript approach if we hit a roadblock with SQLite, but we'll cross that bridge when we come to it.
Congrats @mirnovov on the bounty acquisition! Can't wait to see what you come up with!
@kepano Happy to help!
I do however, humbly request that you consider concurrent approaches or future solutions to this project. In my research, I have come to the conclusion that at minimum the SQLite and Apple Shortcut approach must be implemented to complete all of the project requirements.
The SQLite approach will be needed for past, current or future datastore retrieval no matter what. I am still unsure if it will be able to retrieve IOS 17 internal links, but I am sure @mirnovov will figure that out. Although, I do know it is not an IOS solution.
I have successfully built an Apple Shortcut as a standalone to extract, decrypt and export Apple Note files. I have also created a simple export shortcut to export Apple Note Files and attachments to a zip that can then be read by the Obsidian importer (see demo below.)
In my research, I have not been able to find out how to communicate with internal Apple Note functions on IOS without the use of a third party vendor, Apple Shortcuts or exposing native modules to communicate between Obsidian and Apple Notes.
These solutions should meet all of the listed requirements without
within the constraints of this Obsidian plugin.
!()[image.png]
and placed in the user's defined attachment location (Settings → File & links)I do not mean for this to take away from @mirnovov's bounty as mirnovov has earned it. I would like to see the SQLite solution and the Apple Shortcut solution implemented.
I request, given this new found information, that this solution will be separate from this bounty. I would be happy to sit down and discuss further details at your convenience.
I understand if you do not want to follow through with this approach. I will continue to build it regardless as I still personally need the solution and I am close to wrapping this up.
@BrandanTD thanks — please open Apple Notes Shortcut as a separate issue so we can keep this issue focused on the SQLite approach. Shortcuts could be an alternate path for some users, but we don't see this as the primary solution for Importer. We also accept issues/PRs to the Help repo if you want to document this solution.
I have upgraded to macOS Sonoma and confirm that the internal links can be retrieved (quite easily in fact, since it builds on existing aspects of the data format). Haven't really done too much yet as I have been quite busy lately, but I am confident I can meet the deadline barring exceptional mitigating circumstances.
If I set this importer to run on a cron daily, will it create a ton of duplicates or will it just import new notes?
I would like to use apple notes for daily quick notes and obsidian as long term curated storage.
It will create duplicates, see #142
So given that this is an open issue, Is this on the roadmap to implement?
Thanks, Paul
On Jul 15, 2024, at 2:50 PM, Steph Ango @.***> wrote:
It will create duplicates, see #142 https://github.com/obsidianmd/obsidian-importer/issues/142 — Reply to this email directly, view it on GitHub https://github.com/obsidianmd/obsidian-importer/issues/15#issuecomment-2229408070, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJE4ZWGFVFMSTB2C2UX6QLZMQY23AVCNFSM6AAAAABK5GPFLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRZGQYDQMBXGA. You are receiving this because you commented.
Please upvote this issue if you would like to see Apple Notes as an import format.
Bounty
See the Contribution guidelines for how to claim this bounty.
Bounty: $2,500 USD Timeframe: 21 days
Please only apply if you have taken time to explore the Importer codebase, as well as existing options such as Apple Notes Liberator and Apple Cloud Notes Parser. Provide detail about how you would approach solving it within the constraints of this Obsidian plugin.
Requirements
!()[image.png]
and placed in the user's defined attachment location (Settings → File & links)Current solutions