Forum Archive

Workflow Question

rol46

I create workflows to set tags as priorities. When I change a priority, I EXTEND to capture the whole line, then remove the old priority, then Replace what is left with the new priority at the end.

But the tasks are initially indented by 1 tab character, and when the line is replaced, it is no longer indented. I am sure there is a simple fix for this, but I don't know what it is.

Can anyone help?

omz

Can you share an example workflow that exposes this problem?

rol46

I understand the problem differently now. Here is an example:

Taskpaper File --
Project:
Task 1 @later

There is a tab in front of Task 1

  1. Extend selection both ways start/end of line
  2. Find/Replace @later with (null)
  3. Find/Replace regular expression \s+ output (1 space)
  4. Replace Selected Text with Input @now

Extra spaces can accumulate over time, so line 3 cleans that up. But line 3 is also replacing the tab with 1 single space, which is unfavorable behavior!

There must be a way to fix this.

rol46

I solved the problem by find/replace tab with # before doing the find/replace \s+, and after I got rid of excess space, I reverse the fine/replace.

It's a good solution, and if there are 2 or more tabs, it correctly replaces them.