Count Drafts from script?

I’d like to count the total number of drafts from a script, Applescript or bash, whatever really, just something I can automate and run avery day or so and get a figure out with the number of drafts.
Is that possible?
Thanks
D

Could you explain what you are trying to accomplish with that information? The draft count is already displayed in the UI in the draft list, and can be enabled as a badge on the app icon.

What count exactly are you looking for, the current number of drafts in the inbox?

sure, i want to graph my note count across obsidian, Notes and Drafts v time. obviously i don’t want to manually enter this , id like to get the number somehow via either a bash script, applescript or shortcut maybe.

Counting Apple Notes, run on Mac
osascript -e 'tell application "Notes" to count every note'

Counting markdown files in vault
find ~/Obsidian/Vault1 -type f -name "*.md" |wc -l

thanks
D

This would get you that on Shortcuts…

1 Like