Creating Tasks from Text Selections

I've attached what looks like a very complex Keyboard Maestro macro. Fortunately, it is actually more "long" than "complex".

Its purpose is to create a task in OmniFocus based on text that is selected in one of four different applications: Safari, Fantastical, Obsidian or Drafts.

It would be a straightforward process to convert this macro for use with Tana - the same information could be formatted for insertion into the Tana quick add dialog versus the OmniFocus quick add dialog. Only the last few actions would need to be changed. Similarly, it would not be hard to add another application to the mix - perhaps Arc.

(Late edit: Kara Monroe got the macro yesterday and has already added Arc and Mail. Her assessment: “Works like a dream!”)

PopClip appears whenever text is selected. It is therefore convenient (although not necessary) to use a PopClip extension to trigger this macro.

The process starts when text is selected and the OF extension from PopClip is triggered. The macro then…

Step 1: Copies the selected text to the system clipboard using the shortcut ⌘C.

Step 2a: Collects information that will be used to create the note field in the new task. This information is dependent upon which application was used to select the information. The macro matches the KM token %Application%1% to the name of the application being used.

Step 2b: The variable "Instance_OFNote"is loaded with information that will form the note of the new task. The link for Fantastical is created using HookMark. The link for Drafts relies upon the Drafts action, "Get UUID Link to a Draft" that is available for download (no charge) in the Drafts Directory. Notice the use of the "PastClipboard" tokens. Those tokens allow the system clipboard to be used multiple times, without loss of information.

Step 3: Asks for a task title and assigns it to a variable.

Step 4: Only at this point does the macro become specific to OmniFocus. The macro triggers the OF quick add dialog. Information is pasted where it belongs. This step would have to be modified for use with Tana - but that is a problem solved months ago.

The macro then waits for the new task to be modified (e.g., by assigning a project). When done, you are back in the application where the text selection was made. The entire process takes about 5 seconds.

The beauty of macOS is the ease with which multiple applications can be used to perform useful functions. This macro uses eight different applications:

Keyboard Macro

Popclip

Hookmark

Drafts

Obsidian

Fantastical

Safari

OmniFocus

Example: This task was built using information collected by the macro. The red arrows from top to bottom: The title of the task, the selected text, and the link to the draft. I added a project and due date.


The macro:

🟨 → OF ✓ .kmmacros