macdrifter + editorial   88

Todoflow for Editorial and Taskpaper Productivity
Todoflow for Editorial and Taskpaper Productivity

I mentioned Todoflow, a python module for working with Taskpaper files, back when I first started using the system full time. It has a lot of the core query support of Taskpaper right from Python.

Now, the same module is available through an Editorial workflow. The workflow automatically installs the module if needed and supports advanced queries and result folding. It adds some minor enhancements to the Taskpaper query syntax (like a "today" term) but does not support parenthetical (nested) expressions.1

Enter a query like this:

@start <= {today} or @start and not @done

To see all tasks that start before tomorrow that have not been completed. The workflow includes a couple of predefined queries but add your own to the list for quick access.

While the query expression support in Todoflow is not as powerful as Taskmator, it's pretty good. Another downside is that Textexpander is not supported in the text entry box of Editorial so a lot of my old snippets will not function in this workflow. Check out the other Editorial workflows with Todoflow support.

See this site for examples and references for the Taskpaper query syntax. ↩
blog  Taskpaper  Editorial  iOS  Productivity 
june 2015 by macdrifter
Working around Apple
Open Dropbox files from Editorial
iOS  editorial 
february 2015 by macdrifter
Editorial Workflows for Fantastical
Editorial Workflows for Fantastical

Here's an Editorial workflow for use with TaskPaper formatted tasks. You can set a custom tag (I chose @alarm) and it will parse the attribute out to use as the reminder date for Fantastical.1

So an Editorial line like this:

- Post Fantastical workflow for Editorial @mac @alarm(thursday at 7am)

Will be sent to Fantastical as a new reminder with an alert for 7am on Thursday.

Here's one from the workflow directory that creates a link from Fantastical (or Due.app) back to the original Editorial document.

Here's another one that looks for anything resembling a date and sends that to Fantastical.

This is much nicer now that there is a native iPad version. It works with Fantastical for iPhone if that's what you have. ↩
blog  TaskPaper  Editorial 
april 2014 by macdrifter
Bookmarker Macros for Editorial
Bookmarker Macros for Editorial

This pair of macros for Editorial brings a whole new level of bookmarking to text files on the iPad. Ever want to bookmark a specific spot in a text file or remember where you left off editing a text file in Editorial? Me too. So, I created this pair of fairly simple macros. Here's a little demo:

Bookmarker for Editorial from Macdrifter

The first macro saves the current text selection to a text file named EditorialBookmarks in the Dropbox file storage. I chose this design for very specific reasons. I wanted my bookmarks to be transportable from one iPad to another if I get a new device. I also wanted to be able to see exactly what was in my bookmarks file by just looking at the plain text.

Editorial makes this easy with a single action named Get Bookmark URL which generates a string that represents the current document and text selection:

editorial://open/NameOfCurrentDocument.txt?root=dropbox&selection=673-704

Adding a bit more usefulness to this, the Save Bookmark macro also saves a name for the bookmark and appends it all to a bookmark text file.

The partner macro presents a list of the bookmarks in the bookmark text file. Tapping one opens the bookmark and selects the previous range.

Download the Save Bookmark Macro

Download the Open Bookmark Macro
blog  Editorial  iPad 
december 2013 by macdrifter
New Editorial and Pythonista Forums [Link]
New Editorial and Pythonista Forums [Link]

The Pythonista forums have suffered from spammers since almost the first day it went online. No more! There are new forums that sport the same elegant stylings of Editorial.
blog  Editorial  Pythonista  Link 
october 2013 by macdrifter
Markdown to PDF on iOS [Link]
Markdown to PDF on iOS [Link]

Some nice ideas here with a reference back to Caleb's post about using Pandoc on iOS.

I tried using CloudConvert in Editorial but ran into upload errors and the support is almost non-existent. I moved on to other projects but this one is still enticing.
blog  iOS  Editorial  Link 
october 2013 by macdrifter
Tags in Editorial [Link]
Tags in Editorial [Link]

Ever wish Editorial supported tags? Wish granted.

This is quite clever and superior to most application dependent tags. It means the tags are actually part of the document text and transportable anywhere. That's my biggest problem with adopting tags, they are ephemeral and generally lost when moving a document around.

This workflow assumes tags begin with a hash mark, which may not work for many (including me).
blog  Editorial  Link 
october 2013 by macdrifter
Searchable Editorial Repo [Link]
Searchable Editorial Repo [Link]

Check out the new browsable and searchable Editorial workflow repository. It's excellent. The next update to Editorial will include an option for publishing workflows to the repository.

I have three tips for publishing to the new site:

Include your attribution

Don't hardcode login credentials

Provide some documentation in the description and in any Python code
blog  Editorial  Link 
september 2013 by macdrifter
Editorial Workflow — Open Pinboard Link
Modified Pinboard workflow for Editorial. This one opens the link in the browser:
editorial 
september 2013 by macdrifter
Editorial Workflow: Find and Replace with Confirmation
Editorial Workflow: Find and Replace with Confirmation

These are two new workflows from Ole Zorn based on something rather crappy that I made.

These workflows offer an iterative find and replace (with RegEx matching) that displays a dialog for each match. Typically I don't trust a blind find and replace so these are more useful to me.

This one shows the confirmation dialog as a popup alert. The alert obscures a bit of the text but it does the job.

This one shows the confirmation dialog as a popup list selector. This one doesn't obscure as much text but if you tap the text window the workflow ends.

I'll also highlight this search and replace workflow from oxus.net that uses RegEx to do a blind replace on the entire document. It deserves a look simply for the complete lack of Python to make this happen. It's a good demonstration of twiddling the built-in Editorial actions to make new stuff.
blog  Editorial 
september 2013 by macdrifter
Markdown to iThoughtsHD for Editorial [Link]
Markdown to iThoughtsHD for Editorial [Link]

Rob Trew put together a great Editorial workflow for converting a Markdown outline into a tab-indented outline for iThoughtsHD. The really amazing bit is that it preserves Markdown headings, tabbed lists and code blocks.
blog  Editorial  Link 
september 2013 by macdrifter
Editorial Show Clipboard Workflow
Editorial Show Clipboard Workflow

This is a small utility workflow for Editorial to display the current clipboard contents in the console. But I don't want to just see text. If there's an image on the clipboard, I want to see that too. This workflow handles that.

I've chosen not to clear the console with each run. I like to use the console like a little scratch log as I work. Feel free to change that behavior if you prefer a clean console each time.

The current text on the clipboard is display in orange on the console. If there's an image, it is also displayed on the console.

The trick here is to use the Clipboard module in Editorial and check to see if it contains an image. Here's the Python script:

#coding: utf-8
import workflow
import clipboard
import console
import Image

clip_image = clipboard.get_image()
clip_text = clipboard.get()

if not clip_image:
console.set_color((float(238)/255), (float(154)/255), (float(0)/255))
print clip_text
else:
clip_image.show()

Here's what's going on. We capture the clipboard contents in two different ways. This is a bit wasteful, but the iPad can handle it. If there's an image on the clipboard, the clipboard.get_image() method will grab it as a PIL object. If there's just text on the clipboard then this method will return None.

We test to see if clip_image is None in the next if not clip_image statement. This just says if clip_image is empty then there wasn't an image on the clipboard. In this case we use the text we grabbed off of the clipboard with clip_text = clipboard.get(). If there is an image, we jump to the clip_image.show() line that displays the image in the console.

The little touch here is to use the console module to make our text orange on the console. Since the console.set_color() method expect RGB values from 0 to 1, we need to convert standard RGB values of 0 to 255. That's accomplished with some basic math.

If you've read this far you've probably figured out that this post wasn't so much about sharing a workflow. It's a mini tutorial for using some of the basic Python methods in Editorial. I figured that was generally more useful to people that feel a bit overwhelmed with making Editorial do amazing new things.
blog  editorial 
september 2013 by macdrifter
Editorial Copy Document Workflow
Editorial Copy Document Workflow

Occasionally I'll start a document in the local Editorial file storage and want to upload it to Dropbox. Sometimes it's the other way around.

This workflow copies the current local file to Dropbox or the current Dropbox document to the local storage in Editorial. It's smart enough to know which option is appropriate.

The code for copying the file is actually pretty simple. The trick is figuring out where the file currently lives. For this purpose, I've created the following action.

The variable origLocation is populated earlier in the script with the current document URL. The Editorial URL scheme contains a parameter that called root that defines where the document is stored. The parameter can be either dropbox or local.1

By testing the URL we can see if the document lives in Dropbox or not.

This workflow creates new versioned documents when copying to Dropbox but will overwrite an existing file when copying to the local storage. The pop-up message provides an appropriate warning.

Technically it can also be absent, which means the document is stored locally. ↩
blog  Editorial 
september 2013 by macdrifter
Pycrumbs Python Tutorial [Link]
Pycrumbs Python Tutorial [Link]

What a fantastic Python intro. As Chewing Pencils says, this is great for people getting into Editorial.
blog  Python  Editorial  Link 
august 2013 by macdrifter
Secondary Pythonista [Link]
Secondary Pythonista [Link]

AppStorm has a very good series about programming Python in Pythonista. If you are just getting into Editorial then you really want to catch up on this series as well as their introduction, Pythonista 101.
blog  Python  iOS  Editorial 
august 2013 by macdrifter
Create New Time Stamped Files in Editorial
Create New Time Stamped Files in Editorial

Here are a pair of Editorial macros that do something very simple that I find extremely useful. They create a new file in Dropbox titled with a time stamp.

The first one just names the file with the current time stamp and adds a date header.

The next one asks for a title, appends the time stamp and then creates the new Dropbox file. It also creates a title header with just the user entered title and a date header with the time stamp.

Like this:

Take a look at the Python scripts if you want some tricks for creating and opening new files in Editorial.
blog  Editorial  iOS 
august 2013 by macdrifter
Editorial SFTP Workflows
Editorial SFTP Workflows

I'm back from vacation and so is this site. To get the life juices flowing, I'm sharing my SFTP workflows for Editorial.1

I use this first one to edit posts I've already uploaded to my host. It reads the first 20 text files in my Pelican raw text file directory and shows them sorted by modification time stamp. Tapping one in the list downloads it to the Editorial local file storage for editing.

This next one can then upload the file to my server over SFTP. I posted my workflow for simple FTP upload but a couple of you jackals wanted SFTP uploads instead. This new workflow uses the Python Paramiko module to do just that. It overwrites any file with the same name, which is what I want to do.2

This combination of workflows gives me the ability to edit files remotely on my web server. Pretty nice for a little iOS text editor.

Here's a quick tip: If you are not into Editorial for iPad, then this site will be pretty boring over the next few weeks. If you are into Editorial, then we should probably exchange friendship-bracelets. ↩

As with most everything that's free on the Internet, these workflows come with no serious support. If the problem is interesting or something that I might use, I'll take a stab at it. But really, you're on your own. That's the great thing about Editorial. You can actually mess with it. ↩
blog  Editorial  iOS 
august 2013 by macdrifter
FTP Upload with Editorial
FTP Upload with Editorial

Here's a workflow that uploads the currently open document in Editorial as a markdown file to an FTP host. I use a variation of this workflow to post here on Macdrifter. In fact, this post was written and uploaded from Editorial.

Here's the detail of the Python script:

import workflow
import editor
import ftplib
import console
import StringIO
import keychain
import pickle
import cgi

# Uncomment this line to reset stored password
#keychain.delete_password('macdrifter', 'editorial')
login = keychain.get_password('macdrifter', 'editorial')
if login is not None:
user, pw = pickle.loads(login)
else:
user, pw = console.login_alert('FTPS Login Needed', 'No login credentials found.')
pickle_token = pickle.dumps((user, pw))
keychain.set_password('macdrifter', 'editorial', pickle_token)

#

remotePath = "/home/my/full/path/"
host = "hostname.com"
port = 22

docTitle = workflow.get_variable('postTitleVar')
fileName = docTitle+'.md'
confirmation = console.alert('Confirm', 'Go ahead and post?','Yes','No')

postContent = editor.get_text()

# Text encoidng sucks!
encode_string = cgi.escape(postContent).encode('ascii', 'xmlcharrefreplace')
#postContent.encode('ascii', 'replace')

buffer = StringIO.StringIO(encode_string)
#buffer.write(postContent)
buffer.seek(0)

try:
ftp = ftplib.FTP(host, user, pw)
ftp.cwd(remotePath)
ftp.storbinary('STOR '+ fileName, buffer)
ftp.quit()
except Exception, e:
print e
console.alert('Error', e)

action_in = workflow.get_input()
console.hud_alert('Posted '+fileName, 'success')

# Extension point to do something after the file is uploaded
action_out = action_in

workflow.set_output(action_out)
blog  editorial 
august 2013 by macdrifter
Editorial Workflow — Custom Actions Pack
RT : If you're more into building your own things, the "Custom Actions Pack" might still be useful:
editorial  from twitter
august 2013 by macdrifter
Editorial Workflows on Pinboard [Link]
Editorial Workflows on Pinboard [Link]

Until there's a more formal organization of Editorial workflows, I'll be adding those that I find to Pinboard with the editorial tag
blog  editorial 
august 2013 by macdrifter
Editorial Workflow: Encode Unicode to HTML
Editorial Workflow: Encode Unicode to HTML

This workflow takes selected text in the Editorial editor and replaces it with HTML encoded character strings.

It's just a few actions:

The magic is in the bit of Python that uses the CGI module and should handle most non-english characters as well as special characters like emdash.

#coding: utf-8
import workflow
import cgi

action_in = workflow.get_input()

tempString = workflow.get_variable('origString')

encodeString = cgi.escape(tempString).encode('ascii', 'xmlcharrefreplace')

#TODO: Generate the output...
action_out = encodeString

workflow.set_output(action_out)

You can download the workflow
blog  editorial  iOS 
august 2013 by macdrifter
Editorial Workflow — ForMd
Started experimented with Editorial workflows. Convert highlighted text into reference styled markdown links:
editorial 
august 2013 by macdrifter
« earlier      
per page:    204080120160

Copy this bookmark:



description:


tags: