-
Notifications
You must be signed in to change notification settings - Fork 9
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
First working version #2
Comments
I think the AppleScript I want to pass to tell application "Notes"
repeat with eachNote in every note
set noteId to the id of eachNote
set noteTitle to the name of eachNote
set noteBody to the body of eachNote
log "------------------------" & "\n"
log noteId & "\n"
log noteTitle & "\n\n"
log noteBody & "\n"
end repeat
end tell But there are a few more properties I'd like to get - created and updated date for example. |
I opened the "Script Editor" app on my computer, used Window -> Library to open the Library panel, then clicked on the Notes app there. I got this: So the notes object has these properties:
I'm going to ignore the concept of attachments for the moment. |
My prototype showed that images embedded in notes come out in the HTML export as bas64 image URLs, which is neat. |
Converting AppleScript date strings to ISO format is hard! https://forum.latenightsw.com/t/formatting-dates/841 has a recipe I'll try:
Not clear to me how timezones work here. I'm going to ignore them for the moment. |
Before that conversion:
After:
|
It doesn't have tests yet. I guess I'll need to mock |
OK, this works! |
It's going to shell out to
osascript
as seen in:I'm going with that option because https://appscript.sourceforge.io/status.html warns against the other potential methods:
But
osascript
looks pretty stable to me.The text was updated successfully, but these errors were encountered: