Drafts to particular place in Obsidian daily note

Has anyone created a file-based action for sending from Drafts to a particular place in today’s Obsidian Mobile daily note? (rather than simply append or prepend to it)

I’ve found the Obsidian QuickAdd plugin macro to insert content, say, after “## Log” in daily note within Obsidian. But I’d love to do from Drafts without having to launch Obsidian Mobile app. (As file-based action ‘Save in Obsidian’ does nicely for new notes.) Thanks.

I also thought about that - the only „problem“ with that is that users might have different formats for the daily note filename so it’s something that a user would need to configure before using the action.

I‘ll look into it :blush:

1 Like

There you go @mwjames I created too actions to add content to the Daily Note, one just to append / prepend it and one to add it to a specific section:

Add to Obsidian Daily Note
Add to Obsidian Daily Note Section

Please go through the docs and let me know if it works for you :slight_smile:

1 Like

Wow, thanks, FG! :tada: Will report after checking out.

1 Like

FG, thank you so much! This solves my problem.

I did need to add this to the ‘Add to Obsidian Daily Note Section’ script at line 30:

// MWJ 20221026: Added missing textAddPrefix
//splits[1] = “\n” + draft.content + “\n” + splits[1]
splits[1] = “\n” + textAddPrefix + draft.content + “\n” + splits[1]

For some reason, in my Obsidian setup in macOS, the “\n” adds too many line breaks, so I removed them. In contrast, they’re needed in my Obsidian setup in iOS.

That’s weird…
Are you sure that it adds more newlines and it’s not a display thing on macOS?
Maybe also a plug-in that affects it on macOS?
I can’t test it right now on a Mac since I don’t have access to my own for some time.

The action only adds the newlines to the file so it should work similar on macOS and iOS…

Sure you did not just have extra line feeds in the text of the draft you were testing with on the Mac? It looks like the action just passes along the full content of the draft, it would not strip out extra feeds in the draft.

Actually also a good idea to strip them… I’ll see if more people run into that „issue“

Could easily be the heavy plugin/CSS customization I have in my macOS instance of vault that’s not present in my sync’d Obsidian Mobile instance. Sending from iOS Drafts to sync’d Obsidian vault for use in macOS is my main use case, and that’s landing perfectly (in my case, as bulleted list item, no space before or after, under “### Log”).

I’m excited about this, and am expecting to use it a lot. Thank you!

1 Like