Create button to add empty line to top of draft?

I often copy text into drafts and send to omnifocus. Usually I want to quickly type the task name in the top line but I find I have to move cursor to the top - hit return - then return cursor to the top again and I felt like there might be a way to add an action to the keyboard to handle this instead… would anyone know how to accomplish this?

A few questions to get a better feel for your overall ideal workflow:

  1. When you copy the text into Drafts, do you want to add the title text at that point; if so are you going via the share sheet or some other method such as simply pasting in from the clipboard?
  2. If you do want to add the title to the draft after it is in Drafts and your cursor is elsewhere in the draft, do you want to be prompted to simply enter the title and keep the cursor in the current position in the draft, or do you definitely want to insert a new line at the top of the draft and place the cursor on that top line?
  3. Do you use anything to indicate a title (e.g. a # link in Markdown), where you might want to submit to OmniFocus and only be prompted for a title if one does not exist.

Taking it at face value, a script action to prefix the draft and place the cursor selection would probably be the simplest approach, taking just one line for each part.

editor.setText("\n" + editor.getText());
editor.setSelectedRange(0, 0);

I’m just wondering if there’s something more to this request in terms of streamlining when looked at more broadly?

2 Likes

Nice. This works perfect! Thank you!

Usually I dump text and title later as a triage to wherever it needs to go (instead of at capture)

I like your other idea for a ‘prompt’ for title that leaves you where you are. But honestly cursor at top is good since many times I’ll add title then enter to add more of a focused thought with captured text/note below that. So this is great.

Yeah - I do have the omnifocus smart tasks action enabled - but I also find jumping to the top of the note useful for other notes too like sending to email, etc.

Thanks!