Editorial Workflows

Current line to Fantastical

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: (Generalisation of Derek Fay's very useful 'Selection to Fantastical')

1. Gets the whole text of the line containing the cursor,
2. prepares a version of the line in which *any* date/times enclosed in TaskPaper-style tags will be intelligible to Fantastical, and
3. sends the cleaned line to Fantastical for parsing.

Shared by: Rob Trew

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Run Python Script ?
Source Code
#coding: utf-8
import workflow, editor, re

DATE_TIME_TAG = """
    \s+\@                # space and ampersand
    ([a-z]+)             # tag name (group)
    \(
    (\d{4}-\d{2}-\d{2})  # year (group)
    \s*									 # possibly a time-delimiting space
    ((|\d{2}:\d{2}))     # possibly a time (group)
    \s*\)                # the closing bracket
"""                      

# GET THE TEXT OF THE WHOLE LINE CONTAINING THIS CURSOR
(lng_seln_start, lng_seln_end) = editor.get_selection()
(lng_line_start, lng_line_end) = editor.get_line_selection()
editor.set_selection(lng_line_start, lng_line_end)
str_line = editor.get_selected_text()

# RESTORING THE ORIGINAL SELECTION
editor.set_selection(lng_seln_start, lng_seln_end)

# a version of the line with space around the names 
# and date/times of any date-time tags (eg for Fantastical parsing)
rgx_tag = re.compile(DATE_TIME_TAG, re.VERBOSE)
workflow.set_output(rgx_tag.sub(' \\1 \\2 \\3', str_line))
URL Escape ?
Open URL ?
Open in
  • In-App Browser
  • Default App / Safari
URL
fantastical2://parse?sentence=Input
Tab
  • Last-used Tab
  • New Tab
  • Tab with ID:
Unique identifier
Wait until Loaded
OFF
Reveal Browser Automatically
ON