Skip to content

Instantly share code, notes, and snippets.

@omz
Created January 22, 2013 14:58
Show Gist options
  • Save omz/4595251 to your computer and use it in GitHub Desktop.
Save omz/4595251 to your computer and use it in GitHub Desktop.
This gist contains a workflow for Editorial, an app for
writing plain text and markdown on iOS.
To import the workflow, copy the *entire* text of the gist,
then open Editorial and create a new workflow.
------------ BEGIN WORKFLOW ------------
{
"actions" : [
{
"class" : "WorkflowActionGetEditorText",
"parameters" : {
}
},
{
"class" : "WorkflowActionRunScript",
"parameters" : {
"script" : "#coding: utf-8\nimport workflow\nimport re\n\naction_in = workflow.get_input()\np = '\\[[^\\]]*\\]\\(([^\\s]*)\\s\"([^\"]+)\"\\)'\nmatches = re.findall(p, action_in)\nlines = '\\n'.join([m[1] + '\\t' + m[0] for m in matches])\nworkflow.set_output(lines)\n\n"
}
},
{
"class" : "WorkflowActionCondition",
"parameters" : {
"expression1" : {
"text" : "?",
"type" : "advancedText",
"tokenRanges" : {
"{0, 1}" : "Input"
}
}
}
},
{
"class" : "WorkflowActionShowAlert",
"parameters" : {
"title" : "No link titles found.",
"showCancelButton" : false,
"button1Value" : {
"text" : "?",
"type" : "advancedText",
"tokenRanges" : {
"{0, 1}" : "Input"
}
},
"message" : {
"text" : "",
"type" : "advancedText",
"tokenRanges" : {
}
}
}
},
{
"class" : "WorkflowActionStopWorkflow",
"parameters" : {
"showHUD" : false
}
},
{
"class" : "WorkflowActionConditionEnd",
"parameters" : {
}
},
{
"class" : "WorkflowActionSelectFromList",
"parameters" : {
"list" : {
"text" : "?",
"type" : "advancedText",
"tokenRanges" : {
"{0, 1}" : "Input"
}
}
}
},
{
"class" : "WorkflowActionShowAlert",
"parameters" : {
"title" : "Selected URL",
"showCancelButton" : false,
"button1Value" : {
"text" : "?",
"type" : "advancedText",
"tokenRanges" : {
"{0, 1}" : "Input"
}
},
"message" : {
"text" : "?",
"type" : "advancedText",
"tokenRanges" : {
"{0, 1}" : "Input"
}
}
}
}
],
"name" : "Show Link Titles"
}
------------- END WORKFLOW -------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment