Editorial Workflows

@Tags

unlisted 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: Updated version of taskpaper @tag filtering. Now shows list of tags with values as options to filter. If you select the tag without the value it will show all tags. Example:

@shop --> shows all tags regardless if tags have a value or not
@shop(homedepot) --> only shows homedepot value @shop tags matches.

Automatically folds lines matching the tag you select from the list.

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Stop If No Document is Open... ?
Run the block if
File Name
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Show Alert ?
Title
No Document Open
Message
You need to open a document to use this workflow. It uses the current document's path to determine where to search.
Button 1
OK
Output Value
Button 2
(don't show)
Output Value
Button 3
(don't show)
Output Value
Show Cancel Button
OFF
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import editor
import console
import re
import os
import sys
from collections import defaultdict
from collections import OrderedDict
import codecs
from StringIO import StringIO

def autoVivify():
	return 0

full_path = editor.get_path()
tagGroup = defaultdict(autoVivify)

from urllib import quote
try:
	with codecs.open(full_path, 'r', 'utf-8') as f:
		for line in f:
			m = re.findall('\s{1}(\@\w+)', line)
			n = re.findall('\s{1}(\@\w+\(.*\))', line)
			if re.search('\@done', line):
				continue
			else:
				for i in m:
					if i == '':
						pass
					else:
						tagGroup[i.strip()] += 1
				for i in n:
					if i == '':
						pass
					else:
						if re.search('(\@due)|(\@start)',i):
							continue
						else:
							tagGroup[i.strip()] += 1

except UnicodeDecodeError, e:
	pass

tagList = []
tags = ''
for key, value in tagGroup.iteritems():
	tagList.append(key)
	
tagList = sorted(tagList)

for i in tagList:
	tags = tags + i + '\n'

action_out = workflow.set_output(tags)
Select from List ?
Title
List (Lines)
Input
Multiple Selection
OFF
Show in Popover
OFF
Set Variable ?
Variable Name
Search Term
Value
Input
Unfold All Text ?
Fold Lines Containing… ?
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Search Term|.*\:$
Invert
ON
Fold Lines Containing… ?
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
@done
Invert
OFF