Editorial Workflows

Create link to current file

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: Creates a markdown link to the current file

Note: The link will only work in Editorial

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Run Python Script ?
Source Code
#coding: utf-8
import editor
import urllib
import clipboard
import console

db_path_identifier = 'Library/Application Support/Dropbox'

path = str(editor.get_path())
if db_path_identifier in path:
	location = '?root=dropbox'
	path = path.split(db_path_identifier, 1)[1]
else:
	location = ''
	path = path.split('/Documents/', 1)[1]

url = 'editorial://open/' + urllib.quote(path) + location

markdown_link = '[]({})'.format(url)

clipboard.set(markdown_link)

console.hud_alert('Copied link to file to clipboard')