Editorial Workflows

Send to Fantastical

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: Extracts the current line as a Reminder text. Extracts the @alarm tag as the reminder date. Sends to Fantastical for parsing.

User may change the alarm tag variable and default calendar varible to customize the usage.

Supports x-callback-url to return to editorial from Fantastical

:::Macdrifter.com
::: v 0.9.4

Shared by: Macdrifter.com

Comments: Comment Feed (RSS)

anonymous — 04 Feb 2016
Doesn't quite work---adds the @alarm(foo) text to the note which confuses Fantasical

+ Add Comment

Workflow Preview
Set Default Calendar for Reminder ?
Variable Name
calendar
Value
/home
Set Custom Alarm Tag ?
Variable Name
alarmTerm
Value
@alarm
Set Variable ?
Variable Name
remindDate
Value
Set Variable ?
Variable Name
remindText
Value
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import editor
import re


alarm_term = workflow.get_variable('alarmTerm')

remind_pattern = re.escape(alarm_term) + r'''\((.+?)\)'''

action_in = workflow.get_input()

(i_line_from, i_line_to) = editor.get_line_selection()
editor.set_selection(i_line_from, i_line_to)
line = editor.get_selected_text()

pattern = re.compile(remind_pattern)

for match in re.finditer(pattern, line):
	workflow.set_variable('remindDate', match.group(1))
	workflow.set_variable('remindText', line)



action_out = action_in

workflow.set_output(action_out)
Move Caret ?
Direction
  • Backward
  • Forward
  • Start/End of Document
  • Start/End of Line
  • Number of Characters:
1
Generate Text ?
Text
todo remindText at remindDate calendar
If… ?
Run the block if
remindDate
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
URL Escape ?
Open URL ?
Open in
  • In-App Browser
  • Default App / Safari
URL
fantastical2://x-callback-url/parse?sentence=Input&x-source=editorial&x-success=editorial://&x-cancel=editorial://&x-error=editorial://
Tab
  • Last-used Tab
  • New Tab
  • Tab with ID:
Unique identifier
Wait until Loaded
OFF
Reveal Browser Automatically
ON
…End If