Editorial Workflows

Paste with consistent tab depth

public workflow

Install Workflow

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: When pasting a list of Taskpaper items (or any bulleted list) into another list, I find myself doing the following:

- press return for new line
- delete auto-generated space
- delete auto-generated bullet (-)
- paste

And sometimes:
- curse myself for forgetting that the tab depths of the items on the clipboard and the paste location are different
- adjust indents on each line to match desired tab depth

This workflow is just a way to make pasting a list into a list easier. Cut a list, place the cursor in the line you want the pasted items to appear after, and run— the workflow gets the current line, determines tab depth from that, and pastes the clipboard appropriately. Successive depths of indents within the pasted items are also respected.

All usual disclaimers (it works for me; I accept no responsibility if your house falls down when you run this workflow, etc) apply.

2018-04-09
v 1.1 - now with added consistency (and all the difference a "+" makes in a regular expression...)! Also initialises tabcount as a zero value, for those of you copying unindented tasks into your lists.

Shared by: @jsamlarose

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Extend Selection ?
Direction
  • Backward
  • Forward
  • Both
Unit
  • Start/End of Document
  • Start/End of Line
  • Number of Characters...
1
Set Variable ?
Variable Name
line
Value
Input
Find ?
Search for
\t+
Match Group (RegEx)
0 (entire match)
Search Type
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Output
  • Found Text
  • Range of Text (from:to)
Set Variable ?
Variable Name
tabspacing
Value
Input
Math ?
Expression
tabcount + 0
On Error
  • Stop Workflow
  • Output "ERROR"
Result
  • Pass to Next Action
  • Store in Variable:
tabcount
Get Clipboard ?
Find ?
Search for
\A.*
Match Group (RegEx)
0 (entire match)
Search Type
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Output
  • Found Text
  • Range of Text (from:to)
Repeat… ?
Repeat with
  • Every Line
  • Every Match of Regular Expression:
\t
Match Group
0 (entire match)
Reverse
OFF
Math ?
Expression
tabcount + 1
On Error
  • Stop Workflow
  • Output "ERROR"
Result
  • Pass to Next Action
  • Store in Variable:
tabcount
…End Repeat
Get Clipboard ?
Find / Replace ?
Find
(\t{tabcount})(-)
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
tabspacing-
Replace Selected Text ?
Replacement Text
line Input