Change title in OmniFocus task


I’m trying to write a simple (?) keyboard maestro to convert an existing OmniFocus task to a ‘waiting for’ task. If the title of the task is “do something”, I just want: (1) the title to be replaced by “Person: do something”, where “Person” is the name of the person I’m waiting for, and (2) add a “waiting for” tag. I have been unable to get the first part to work.

It seems this is it failing at ‘find and replace’ section, which fails to add the "Person: " bit at the beginning of the task.

I was wondering if anybody has any ideas on how to make it work. Thanks.

Create Waiting Item.kmmacros (8.1 KB)

I think you could do this without a lot of the variable manipulation and just modify the clipboard, but as you have it written, I think your "search and replace" action should be to "system clipboard" and not to "source" and it will work. Your final action is pasting the clipboard, but you've never written the "NewTask" variable to the clipboard, so your clipboard is still stuck at the result from the "Copy as Taskpaper" action

Hi @rolian, thanks for catching that. I was actually messing around with the macro and forgot to update that bit, but the problem isn't what you identified.

I've been creating these variables instead of changing the clipboard directly so I can figure out where is the failure. In the attached version/screenshot, you can see I'm displaying the variables. In the last window, NewTask and SystemClipboard are always the same, but the latter should have WaitWho prepended.

As a test, I replaced %Variable%OldTaskName% by the actual text that I know should be replaced (which is the same as the variable) and this works every time.

I'm baffled.

Create Waiting Item.kmmacros (8.2 KB)

Ok, I sorted it out. The key was to replace the search and replace by a simpler construction for the new task name. The attached version also adds the right "waiting for' task. As @rolian suggested, all the variable manipulation is mostly not needed and the changes can be applied to the System Clipboard.

Thanks.Create Waiting Item.kmmacros (6.8 KB)