Editorial Workflows

Send to OMZ Forums

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: This workflow sends the current document to the omz:software forums. The post's title will be the name of the file and the content will be the content of the file.

You will need the corresponding JavaScript bookmarklet to fill the title and content. The bookmarklet's code is:

javascript:var urls = window.location.href.split('?'); if (urls.length > 1) { var params = urls[1].split('&'); for (x=0; x<params.length; x++) {var p = params[x].split('='); if (p.length == 2) {if (p[0] == 'omztitle') {var title=decodeURIComponent(p[1]); var titlebox=document.getElementsByName('title')[0]; titlebox.value=title;} else if (p[0] == 'omzcontent') {var content=decodeURIComponent(p[1]); var contentbox = document.getElementById('wmd-input'); contentbox.value=content}}}}

Shared by: Rainman Noodles

Comments: Comment Feed (RSS)

Tutorial Doctor — 25 Dec 2014
Thanks Rainman for this!
@ClareMacraeUK — 27 Dec 2014
See also this almost identical workflow - http://www.editorial-workflows.com/workflow/5212661281193984/4Moby56VuGo - "Send to OMZ Forums in Built-in Browser" - which posts via the built-in browser, and so doesn't require any JavaScript bookmarklet to be created.

+ Add Comment

Workflow Preview
Get Current File Name ?
Include Folder
OFF
Include Extension
OFF
Set Variable ?
Variable Name
posttitle
Value
Input
Document Text ?
Folded Text
  • Include
  • Replace with:
Set Variable ?
Variable Name
postcontent
Value
Input
Select from List ?
Title
Which forum?
List (Lines)
Pythonista Editorial
Multiple Selection
OFF
Show in Popover
ON
Set Variable ?
Variable Name
forum
Value
Input
If… ?
Run the block if
forum
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Editorial
Select from List ?
Title
Category
List (Lines)
General Workflows Questions
Multiple Selection
OFF
Show in Popover
ON
Set Variable ?
Variable Name
category
Value
Input
…End If
If… ?
Run the block if
forum
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Pythonista
Select from List ?
Title
Category
List (Lines)
General Share Code Questions
Multiple Selection
OFF
Show in Popover
ON
Set Variable ?
Variable Name
category
Value
Input
…End If
Run Python Script ?
Source Code
#coding: utf-8
import workflow
#import clipboard
import urllib

forumname = workflow.get_variable('forum').lower()
categoryname = workflow.get_variable('category')
#print 'Forum: '+forumname
#print 'Category: '+categoryname

posttitle = workflow.get_variable('posttitle')
postcontent = workflow.get_variable('postcontent')
#print 'Title: '+posttitle
#print 'Content: '+postcontent

url = 'https://omz-forums.appspot.com/'+forumname+('/new?category=%s&omztitle=%s&omzcontent=%s' % (urllib.quote(categoryname), urllib.quote(posttitle), urllib.quote(postcontent)))

workflow.set_output(url)
Open URL ?
Open in
  • In-App Browser
  • Default App / Safari
URL
Input
Tab
  • Last-used Tab
  • New Tab
  • Tab with ID:
Unique identifier
Wait until Loaded
OFF
Reveal Browser Automatically
ON