Editorial Workflows

Link Multiple Selections

public workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the 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: Given multiple saved text selections (type "n" to break the repeat loop), the workflow add an inline link for each non-contiguous selection from the built-in browser.

Shared by: @viticci

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Set Variable ?
Variable Name
sel
Value
Set count (generate text with specified number of lines) ?
Run Python Script ?
Source Code
import editor
import console
import workflow

count = workflow.get_input()
s = workflow.get_variable('sel')
console.clear()

for line in count:
	x = raw_input('Save More Text?\n\nSelect some text and enter \'y\' or \'n\':')
	if 'y' in x:
		s += '\n' + str(editor.get_selection())
		workflow.set_variable('sel', s)
	if 'n' in x:
		break
Generate Text ?
Text
sel
Remove Whitespace ?
  • Trim leading/trailing whitespace
  • Remove empty lines
Find / Replace ?
Find
(
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
Find / Replace ?
Find
)
  • Case-insensitive (A = a)
  • Case-sensitive (A ≠ a)
  • Regular Expression
Replace with
Sort Lines ?
Sort Order
  • Ascending (A → Z)
  • Descending (Z → A)
Set Variable ?
Variable Name
sel
Value
Input
Generate Text ?
Text
sel
Repeat… ?
Repeat with
  • Every Line
  • Every Match of Regular Expression:
Match Group
0 (entire match)
Reverse
ON
Run Python Script ?
Source Code
import editor
import workflow

range = workflow.get_input()
sel = range.split(',')

editor.set_selection(int(sel[0]), int(sel[1]))
Show HUD ?
HUD Text
Choose URL for Selected Text
Duration
  • 1 Second
  • 2 Seconds
  • 3 Seconds
Icon
  • "Success"
  • "Error"
Set Variable ?
Variable Name
browser
Value
(Browser URL "Browser Title")
Replace Selected Text ?
Replacement Text
[Selected Text](Browser URL "Browser Title")
…End Repeat