-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract text formatting information #24
Comments
Do you know if Notes stores hyperlinks in the same way that it does other text formatting? The biggest issue I have dealing with Notes content is that most export methods (including For example, if you add some text to a note, e.g. "Wikipedia", and convert it into a link by selecting the text and pressing cmd-k then setting the destination to "https://www.wikipedia.org/", this works as a normal, clickable hyperlink within Notes. But once this note has been exported, you're left with just the word "Wikipedia" with no link/URL. The only way I've found to preserve links is to select all the text in the note, copy it to the clipboard, and then paste it into another app that supports rich text. Not ideal for multiple notes, although the process could be scripted. To sum up, I'm wondering whether "preserve links" is a separate feature request, or if it'd come "free" with text formatting. I spent some time browsing the database and it wasn't obvious to me where Apple is storing this information. |
Hi there! I've added rudimentary support for extracting links in
More detailed informationYeah Notes does store hyperlinks in a similar way to other text formatting. It keeps a list of what it calls Example// Pseudocode
// myNoteProto is a NoteStoreProto
note = myNoteProto.document.note
noteText = note.noteText
formattingInformationObjects = note.attributeRunList
formattingObjectNoteTextIndex = 0
for each formattingInfo in formattingInformationObject
// current formattingInfo is located in note text at formattingObjectNoteTextIndex and continues for formattingInfo.length
// we could for example replace the note text between formattingObjectNoteTextIndex and formattingInfo.length with whatever
// representation of formattingInfo suits us best
// then we move along the formattingObjectNoteIndex in preparation for the next formattingInformationObject
formattingObjectNoteTextIndex += formattingInfo.length Right now I'm not replacing any actual note text, but extracting the link text follows the same procedure. You can see it here: apple-notes-liberator/src/main/java/de/hamburgchimps/apple/notes/liberator/data/NoteData.java Line 123 in a953da1
I hope this helps a little bit! |
Useful for #19.
The text was updated successfully, but these errors were encountered: