logoalt Hacker News

shukalast Tuesday at 4:57 PM6 repliesview on HN

I've used Apple Notes for years because it syncs fast and stays out of the way. But when I'm writing in the terminal, there's always been friction getting Markdown into Apple Notes.

Existing tools were either bloated or read-only. So I built Stash: push a Markdown file to Apple Notes, pull changes back. It uses YAML frontmatter to track which note belongs to which file.

Built with Bash, AppleScript, and Pandoc. No databases, no daemons, no config files. Install via Homebrew. Happy to take suggestions and answer questions about the quirks I ran into along the way.


Replies

nozzlegearlast Tuesday at 6:53 PM

I love Apple Notes, but I also love writing in vim; looks like I can finally reconcile those two things thanks to your project. Nice work!

> questions about the quirks

I've used a decent amount of AppleScript to automate things on my Mac, so I know it's a powerful tool but not easy to just jump into, even when you're already familiar with that bizarre syntax. What kinds of quirks did you run into?

nemosaltatlast Wednesday at 8:35 AM

>Happy to take suggestions and answer questions about the quirks I ran into along the way. Got up out of bed from doomscrolling to play with/implement this! My less-technical partner tends to reach for Apple Notes and I have offered/threatened to make something, but they've kept (begrudgingly) relaunching VSCode after a "oof, I know it was just real quick." Thanks for the inspiration/headstart.

Someonelast Tuesday at 9:13 PM

“Fun”. In the latest MacOS, Apple Notes supports markdown export (https://support.apple.com/en-md/guide/notes/not201900c07/mac), but not through its AppleScript dictionary.

So yes, it seems you do need Pandoc to do html-to-markdown and vice versa.

d4rkp4tternlast Wednesday at 2:24 PM

Sounds very useful! Does it handle images in both directions ?

happyopossumlast Tuesday at 9:39 PM

This looks cool, so obviously I have questions!

Does it support pushing to personal/home/this-is-my-note.md, or does everything wind up in the Notes root?

It appears notes have to start out externally in order to "stash pull" them, is that the case?

thanks!

angst_riddenlast Tuesday at 6:34 PM

How hard would it be to extend this to support bulk export of Apple Notes?