Editorial Workflows

Statistics (chars w./o. spaces)

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: Adapted the standard workflow to also show characters without spaces.

Shows statistics about the selected text(word count etc., including characters without spaces). If no text is selected, the statistics refer to the entire document.

Shared by: @openmedi

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Stop if no document... ?
Run the block if
File Name
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
ON
Message
No Document Selected
…End If
If text is selected... ?
Run the block if
Selected Text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Set Variable ?
Variable Name
Text
Value
Selected Text
Set Variable ?
Variable Name
Title
Value
Statistics (Selection)
…End If
Else... (use all text) ?
Run the block if
Selected Text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Document Text ?
Folded Text
  • Include
  • Replace with:
Set Variable ?
Variable Name
Text
Value
Input
Set Variable ?
Variable Name
Title
Value
Statistics (Document)
…End If
Generate Text ?
Text
Text
Count ?
What to Count:
  • Words
  • Sentences
  • Lines
  • Characters
Set Variable ?
Variable Name
Words
Value
Input
Generate Text ?
Text
Text
Count ?
What to Count:
  • Words
  • Sentences
  • Lines
  • Characters
Set Variable ?
Variable Name
Sentences
Value
Input
Generate Text ?
Text
Text
Count ?
What to Count:
  • Words
  • Sentences
  • Lines
  • Characters
Set Variable ?
Variable Name
Characters
Value
Input
Generate Text ?
Text
Text
Run Python Script ?
Source Code
import workflow

def char_count(s):
    return len([x for x in s if not x.isspace()])
    
workflow.set_output(str(char_count(workflow.get_input())))
Set Variable ?
Variable Name
nospaces
Value
Input
Math: Words per Sentence ?
Expression
Words/Sentences
On Error
  • Stop Workflow
  • Output "ERROR"
Result
  • Pass to Next Action
  • Store in Variable:
Words per Sentence
Show Alert ?
Title
Message
Title Characters Character(s) nospaces Character(s) without spaces Words Word(s) Sentences Sentence(s) Words per Sentence Word(s) per Sentence (average)
Button 1
OK
Output Value
Button 2
(don't show)
Output Value
Button 3
(don't show)
Output Value
Show Cancel Button
OFF