# Editorial Workflows

## Journal

Create a new journal entry with time stamp and location. The time stamp is currently hard coded to a zone selection list until I need to auto detect it based on location or something. Time zones are hard.

## Insert NWS Nearest Current Weather Conditions

This very quick hack finds the nearest National Weather Service (USA) station, then pulls current conditions from that station, and inserts data at the current cursor position. This may be useful for journaling in Editorial.

## Convert to Ordered List

Converts the selected lines to an ordered (sequentially numbered) list.

.xyz

## Sort Entire Document

Workflow will automaticallly select the entire document and sort each line alphabetically.

## Jekyll with UUID

Sets YAML Front Matter for a Jekyll blog with UUID. Based on earlier work by hackerinterrupted.com, edited for my needs.

## Paste URL

Paste a URL in markdown format. If you selected some text, the text becomes the link text; if not, it inserts a blank line as the link text

## Paste Blockquote

Paste a block quote in markdown format

## List URLs...

Shows a list of URLs in the current document. Selecting one of the URLs opens it in the browser panel.

## List URLs...

Shows a list of URLs in the current document. Selecting one of the URLs opens it in the browser panel.

## Save Photo Copy

Takes first image from the clipboard and saves to document directory using the current document's filename and saving as a jpg. Inserts an tag and sets the width. The width default is 640px and the height is set to aspect ratio.

## Visual Find & Replace

Fixed some crash issue. Enjoy! This workflow uses the UI module to allow you to do a find & replace throughout your selected text or the entire document if no text is selected. The UI was designed to work on both the iPhone and the iPad. Options include: * Text or Regular Expression * Case-sensitive searches * Preview panel to make sure you're replacing what you want to replace (especially helpful for regex). This was adapted from the built-in Diff with Clipboard workflow. If you have any suggestions, find any bugs, or want to see my other workflows for Editorial, please visit http://sweetnessoffreedom.wordpress.com/projects

## WebDAVDir

Workflow to read files from a webdav directory and send them back again (if required after making changes). It should handle the file types supported by Editorial, but up to a point also the (emacs) org type. It does so by converting the org format to markdown upon reading and converting it from markdown back to org upon writing. Note that this md / org conversion is just a hack and can/will mess up your org files. To make this flow work at all, you will have to edit the parameters in the marked (red) workflow step, to hold your personal webdav settings.

## Calculator

A simple, Python-based calculator UI.

## TestInsert

This seems to illustrate a bug with UI buttons in Editorial 1.3.2

## Editorial Backup

Fixed an issue with "ZIP does not support timestamps before 1980" Enjoy! Saves or restores a backup of all Editorial workflows, snippets, bookmarks, and local documents as a zip file in Dropbox (this requires the Dropbox account to be linked). Please note: If you want to restore a backup on a different device, you first have to download the backup file (just tap on it in the document list). This is required because Editorial doesn't sync zip files by default. Restoring a backup will *overwrite* all existing workflows, snippets, and bookmarks, so it's possible that you'll lose data this way. The best way to avoid any data loss is to create a backup before restoring anything.

## Bobbi

Is this fun or what? Easily make a simple website and host it from a free Dropbox account. This workflow creates a website like a one-page blog - it takes the markdown files in a Dropbox folder, joins them together (newest first), converts to html and writes it to the same Dropbox folder. Then you can share the link to your website. Then, hack this to a one-page-per-file website, or a one-page-one-file website. Inspired by Nicoletta (Python) by Roberto Alsina, king of the short piece of quirky code, and named for him.

## ACKS Char

Create random characters for ACKS.

## NPC

Randomly generates an NPC of a selected level and class for Adventurer Conqueror King (basically any OSR D&D clone. Requires aspects and traits data files in a directory called ACKS data. Dropbox link for data files: https://www.dropbox.com/sh/ghopk6jhloiqs5y/rV7ggkYpdr

## Monsters

Select a monster from Adventurer Conqueror King and pull their stats directly into your Editorial document. Requires the Monsters.txt data file installed in ACKS data directory to function. Data files available in Dropbox folder: https://www.dropbox.com/sh/ghopk6jhloiqs5y/rV7ggkYpdr

## Character Aspects

Quick generation of aspects from list.

## Dungeons

A quick script to generate random dungeons for a basic/expert edition-like D&D game. Largely self-sufficient, but requires data files Monsters.txt and treasure.txt installed in ACKS data folder. Dropbox link for data files: https://www.dropbox.com/sh/ghopk6jhloiqs5y/rV7ggkYpdr

## Treasure

Random treasure generation for ACKS.

## Wandering Monsters (Dungeon)

A random encounter workflow for the Adventure Conqueror King system.

## Custom Classes and Functions

This script is used as a sub-workflow by some of my others. It must be installed for them to work properly. Copyright (c) 2017 Duncan MacIntyre Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Next Actions

This script: 1. Opens /Dropbox/Task Management/Next Actions.taskpaper 2. Removes any occurences of @start(YYYY-MM-DD) from this file, where YYYY-MM-DD is on or before today 3. Folds all lines containing @start(YYYY-MM-DD), where YYYY-MM-DD is a future date Another script of mine, "Custom Classes and Functions", must be installed for this to work. Copyright (c) 2017 Duncan MacIntyre Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Insert @start tag

This workflow prompts the user to select a date, then inserts a taskpaper @start(YYYY-MM-DD) tag at the cursor where YYYY-MM-DD is the selected date. Copyright (c) 2017 Duncan MacIntyre Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## List URLs...

Shows a list of URLs in the current document. Selecting one of the URLs opens it in the browser panel.

## Working Copy

Workflow for transferring files from Working Copy to Editorial and back again. When called with input, it will pick the filename from the first line and write the other lines into this file, which lets Working Copy create a new file with predefined content. The filename contains a unique identifier for remembering where it belongs. To avoid overwriting files in Editorial by mistake, the previous contents of files are put in WorkingCopy.bak When this workflow is called without any input the contents of the current file is written back to Working Copy. Change askcommit variable to 0 if you just want to save and not be asked to commit. To install a new version of this workflow delete or rename this one and perform Edit in Editorial from Working Copy.

## Llorem Ipsum

A Lorem Ipsum filler text generator. Source borrowed from Pythonista. Edited a bit.

## Numbered List

A Custom Action to convert text input into a numbered list.

## Unordered List

A Custom Action to convert text input into an unordered list.

## Sort Lines

Sorts selected lines in ascending or descending order, including partially selected lines.

## jump

This workflow uses the Markdown link syntax to let jump between files or create files in editorial. The idea is that you can navigate to the files refrenced in a document more easily and (optionally) can create folders and files be simply referencing them in the document you are currently writing. To use the workflow place your cursor within the bounds of Markdown link with a relative file path and run the workflow. It will then open the referenced file for you. Any link with a specific protocol like http: or file: will be ignored by the workflow. The workflow also does deliberately ignore file extensions so that you can write Markdown files that have working links in their rendered html files. Any link will be interpreted as a link to a Markdown file with the same name. It can handle folders and the command "../" in its file path. If either the referenced folder or file do not exist it will ask you if you want it to create them for you. Newly created files will be empty apart from a link to the file they were created from. Examples: ======= * The link [blah](file_a.md) will open the file file_a.md in the folder of this document. * The link [](file_b..html) will open the file file_b.md in the folder of this document. * The link [)](notes/june/file_c.txt) will open the file file_c.md in the sub folder notes/june/ of this document. * The link [](../file_d) will open the file file_d.md in the folder one folder above the folder of this file. If you are in Documents this will raise an alert. * The link [](../../costs/file_e) will open the file file_e.md in the folder costswhich does lie two folder above the folder of this file. If you are not at least two levels below Documents this will raise an alert.

## Validate Current Document for Not Empty

This routine makes sure that your current file is not empty. If it is, it shows an error and stops the routine. The idea is to use this as a subroutine of a larger routine that's more specific to your situation. I'm using this routine as a sub routine of two other routines, currently. Make sure that when you're setting this up as a subroutine, you specify that it can stop the main routine. Otherwise this won't accomplish anything as a subroutine. It'll just show the validation alert and then stop and your main routine will carry on oblivious to the error.

## Send to Reminders.app

This workflow searches the current document for tags in the format @due(YYY-MM-DD hh:mm) and automatically creates task entries in the iOS Reminders.app. It is based on the Taskpaper format. I've also tweaked the [TP] Set Due Date workflow to make it set the time.

## Share...

Shows the iOS share sheet with the selected text as input. If nothing is selected, the entire document is shared. In a Markdown document, the text can optionally be converted to HTML first.

Shows an input dialog with the selected text or the contents of the clipboard. The result is appended to a "Scratchpad.txt" file.

## GPX Waypoints

Filter out waypoints from a gpx file, for copy-pasting into navigation apps. May need a little editing for differently formatted Gpx files.

## Paste as list

Paste as liste. Paste clipboard content as a markdown / task paper list.

## @hardware search

Slightly modified from another workflow. This one always searches for a specific tag I often need to search. It is a global search.

## Jekyll Micro Compose

Creates the front matter of a Jekyll post to an external link a la a Daring Fireball linked list post.

## New blog post

Create new document with template generated. Prompts for title, but provides a dynamic default of the date (YYYYMMDD.md).

## Insert Image...

Saves an image from the camera roll as a jpeg file in the relatively 'resources' directory, and inserts a markdown image reference,using current time. you can change the label 'yypE' into anything you want.

## KT: Send micropost using Working Copy

This is a sample workflow I use to send a micropost to thecave.com. It creates a Jekyll post and saves it to a Git repository using Working Copy. It prompts you for the post title, category, and additional tags to include in the Jekyll front matter. The workflow includes the tag "micropost" automatically. To use this workflow, change the key and repo variables to match the key and repo name in Working Copy. The key must match the URL key found in Working Copy's Settings > App Integrations section. Working Copy must be installed to use this workflow. https://workingcopyapp.com

## KT: Send Jekyll Post using Working Copy

This workflow creates a Jekyll post and saves it to a Git repository using Working Copy. It prompts you for the post title, category, and tags to include in the Jekyll front matter. To use this workflow, change the key and repo variables to match the key and repo name in Working Copy. The key must match the URL key found in Working Copy's Settings > App Integrations section. Working Copy must be installed to use this workflow. https://workingcopyapp.com

## List URLs...

Shows a list of URLs in the current document. Selecting one of the URLs opens it in the browser panel.

## numbers csv to md table

csv file from Numbers --> md table --> insert into current md doc --> pdf with internal and external table borders

## Print Org TODOs

Scan org files for lines containing todo keywords. Create an on-the-go todo list.

## csv_to_md_table

A workflow for converting csv tables --> markdown tables --> HTML tables with borders --> PDF.

## Decrypt Selected Text

Workflow to decrypt selected text in a document. (A Encrypt Selected Text complement workflow.) If no text is selected an alert is displayed and the workflow stops. Based on Decrypt Document workflow.

## Encrypt Selected Text

Workflow to encrypt selected text in a document. Use Decrypt Selected Text to reverse the process. If no text is selected an alert is displayed and the workflow stops. Based on Encrypt Document workflow. (2017.04.05 added double entry password and exit on no match.)

https://forum.omz-software.com/topic/3931/beginner-custom-ui-how-to-get-the-python-script

## Search Amazon

Allows you to search for [input] on Amazon

## Smart Bold

A workflow best used with an external keyboard. When run with a keyboard shortcut it either: makes the selected text bold, or if there is no text selection it inserts bold operators into the document with the cursor/caret placed between them for easy entry of text.

## Open in...

Shows the "Open in..." menu for the current document.

## Visual Find & Replace

This workflow uses the UI module to allow you to do a find & replace throughout your selected text or the entire document if no text is selected. The UI was designed to work on both the iPhone and the iPad. Options include: * Text or Regular Expression * Case-sensitive searches * Preview panel to make sure you're replacing what you want to replace (especially helpful for regex). This was adapted from the built-in Diff with Clipboard workflow. If you have any suggestions, find any bugs, or want to see my other workflows for Editorial, please visit http://sweetnessoffreedom.wordpress.com/projects

## Insert MD-Table

This Editoral-WF inserts a MD-table template. It prompts the user to either specify a number of columns e.g 4 or a sequence of L, C or R to specify L(eft), C(enterd) or R(ight) alignment, e.g LLCR. The WF prompts the user also for the number of rows. The table will contain placeholders which can easily be selected for editing by double tapping.

## Pandoc

Sends the Markdown, HTML, or LaTeX text that is currently in the editor to the web service Docverter for conversion into Markdown, HTML, LaTeX, PDF, EPUB, or even DOCX. Allows users to turn on several options for Docverter, which uses Pandoc for text conversion. For Markdown, HTML, and LaTeX output, users can choose whether to replace the editor text with the converted text or to place the converted text onto the clipboard. For file output, the workflow will prompt the user to open the returned PDF, EPUB, or DOCX file in an appropriate app. By configuring the red actions in the workflow, users can create custom CSS styles for PDF output can be defined in workflow action and specify a folder where the workflow can look for files referenced by Docverter arguments that require files, such as "template." Requires Editorial 1.1.1. Please report bugs on Twitter.

## TOC/FLOW Preview

Add flowchart support. Any problem can send mail to me. jerry@jerry-chan.com

## Preview with Math

Render MathJax equations in Multimarkdown preview. You can customize the css since it's available as a variable. The default css is the Editorial one.

## library-module-for-editorial

Easy Workflow by @ccc for downloading modules directly into Editorial at ~/Documents/site-packages. See forum discussion for further information: https://forum.omz-software.com/topic/3921/library-module-for-editorial-via-pythonista/17

## Share...

Shows the iOS share sheet with the selected text as input. If nothing is selected, the entire document is shared. In a Markdown document, the text can optionally be converted to HTML first.

## Create link to current file

Creates a markdown link to the current file Note: The link will only work in Editorial

Persistent storage of Editorial variables... Opens a yaml file and does workflow.set_variable() on each key, value pair

## Write yaml

Persistent storage of Editorial variables... Take the current value of several Editorial variables and write them to a yaml file.

## Is A Minor

Assumes that Set Variable 'age' has already been done in the workflow. Returns 'true' if age < 18, 'false' if age >= 18, or 'unknown' if age not defined or has bad characters.

## Net Bible

Online Bible API in a Custom Action.

## My Workflow 1

Filling in variables similar to a form letter

## Form Letter

Demonstrate substitution using Python str.format(**dict). Create a .md file with the following template text: '''Therapy session on {session_date} with {first_name} {last_name}: On {session_date:%B %d, %Y}, Nikki Schwartz had therapy session with {first_name} {last_name} who is a {age} year old {sex} suffering from {issues}.''' Make sure that is the current document in Editorial and then run this workflow.

## Webpage to Markdown

This powerful workflow combines my "Grab HTML" workflow with the 'HTML to Markdown" Custom Action I posted, to automatically generate a markdown document from the current page loaded in the built-in web browser. Thanks to Aaron Swartz. Note: I don't know where in the code to get rid of the console input. Any tips?

## survey

Prompt for bible reference, insert logosres reference as Markdown formatted link, and jump to reference in Logos bible software

Find logosres link on current line and jump to reference in Logos bible software.

## Focus on due date...

After selecting a date, only tasks that contain the @due tag for this date are shown, everything else is hidden (folded).

## Focus on due date...

After selecting a date, only tasks that contain the @due tag for this date are shown, everything else is hidden (folded).

## DDSync

Useful if you have folder trigger on sync data that creates some content such as (PlantUML to generate diagram). This script does a sync of Dropbox twice at an interval of 5 seconds.

## Share...

Shows the iOS share sheet with the selected text as input. If nothing is selected, the entire document is shared. In a Markdown document, the text can optionally be converted to HTML first.

## View Images

This workflow gives the ability to show associated pictures within the same directory with @image tag (particularly usefull in taskpaper documents). How to use : Example @image(name_of_image.png) The name can take all alphanumeric characters and the extension can be jpg or png.

## OmniFocus - Church

Takes selected or inputted text as search terms and executes either a Google search or a search for legal precedent in Google Scholar (user chooses which), and displays search results in Editorial's browser.

## Lucky

This displays top hit of a DuckDuckGo search using selected or inputted text for the search terms.

## Lucky Scholar

Takes selected text or inputted search terms and displays top hit of corresponding Google Scholar case law search. If input is a full case cite, it will take the reporter cite as its search terms. Alter as necessary.

## Lido2AvenzaMaps+

Generates KML for Avenza Maps V1.1.5 - plot route using segments to avoid display problems

## FTP_Client

This is a custom UI for Editorial which will present a fully featured FTP client in a popup window over the editor. After downloading you will need to tap the Info button next to the workflow, go to the Edit Workflow page, tap on the action block to expand it, and fill in your FTP login credentials in the variables below. Once you've done that just run it from the workflow menu and you should be set.