Skip to content

Instantly share code, notes, and snippets.

Greg Pierce agiletortoise

Block or report user

Report or block agiletortoise

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
agiletortoise / GitHub Style.html
Created Mar 29, 2019
Example preview template for Drafts for Mac. Place file in /iCloud Drive/Drafts/Library/Templates to make it available.
View GitHub Style.html
Based on
@font-face {
font-family: octicons-link;
View grammar-markdown.json
"name": "Markdown",
"description": "Basic Markdown syntax based more closely on the original Markdown specification.",
"scopeName": "text.markdown",
"rangeExtension": "lineExtended",
"listCompletion": "markdown",
"fileExtensions": [
agiletortoise /
Created Sep 11, 2018
Drafts 5.4 Release Notes Draft

Drafts 5.4 Release Notes Draft

Siri & Shortcuts Support

  • "Run Shortcut" action step. Pass text to the Shortcuts app and trigger a Shortcut by name with a single tap. This is the same functionality available in the "Run Workflow" action step, updated for the new Shortcuts app.
  • Siri Intents:
    • "Capture clipboard" Siri shortcut. This shortcut allows capture of the current clipboard content to a new draft in Drafts without launching the app.
    • "View draft" Siri Shortcut. Allows creation of a shortcut which displays the content of a specific draft in the Siri interface - with the ability to tap and open that draft in the app. Great for previewing lists, or regularly view reference notes.
  • "Add to Siri" buttons to create voice shortcuts to functions in Drafts directly in the app in the following locations (iOS 12 only):
    • Add shortcut to open a specific draft in the (i) detail view.
agiletortoise / ViewController.swift
Created Oct 5, 2017
How to update input accessory view to handle iPhone X with external keyboard
View ViewController.swift
// ViewController.swift
// TEST_InputViewX
// Created by Greg Pierce on 10/5/17.
// Copyright © 2017 Agile Tortoise. All rights reserved.
// Demonstrates how to update an input accessory view
// to work on iPhone X with external keyboard attached
// using safe area insets.
View Locate app simulator directory
// add "-DDEBUG" to Build Settings > Swift Compiler flags > Other Swift Flags
// stick this code in didFinishLaunchingWithOptions
// then you can easily locate the iOS Sim's app documents directory to check on files.
let dirPath = NSFileManager.defaultManager().URLsForDirectory(NSSearchPathDirectory.DocumentDirectory, inDomains: NSSearchPathDomainMask.UserDomainMask).last?.path
View gist:1ebcdc2c9fc53d0b2c77


Some users have been reporting a "hang" when using Drafts on their devices. Symptoms seem to vary between users who are seeing this issue, but descriptions suggest it is a multi-second hang where the app become unresponsive to touch. Most report suggest the hang stops and the app resumes without crashing after some varying amount of time – usually several seconds.

Some users have reported this occurring on launch of the app, some at random times when using the app. I have not been able to reproduce this issue on any of my test devices, so it has been very difficult to determine a possible cause. If you are seeing this issue, I would like to ask your help in determining what is going on to resolve it.

How to help

If you have a repeatable hang in Drafts, I would like to ask you to capture "stackshots" from your device at the time the hang is happening. This will allow me to better see what is going on at the time of the hang, both in Drafts and elsewhere in your system.

View gist:0727d69ab5cd9b9b13b5

Drafts changelog

As of 10/23/2014, this build has been submitted to Apple for review, but is not yet available in the App Store. This list is provided only for those interested in the fixes coming. For more information, visit our website or follow @draftsapp on Twitter.

  • [MIGRATION FIX] If you received an "Import Failed" error migrating drafts from Drafts 3, please try again with this update. Issue is resolved for all sample data sets I've been able to test.
  • [Fix] Workaround for hang on launch on iOS 8.1 related to iCloud system hang.
  • [Fix] Significant sync improvements across the board.
  • [New] Sync debug logging and ability to email logs to support. If you continue to see sync issues, please contact us – we have now built in a logging facility to better troubleshoot specific sync cases.
  • [New] Redesign of Today widget.
  • [Fix] Deleting an action did not trigger a save of actions as it should, causing deleted actions to reappear if no other action changes we
agiletortoise / gist:f19543567ed61ac28744
Last active Aug 29, 2015
Drafts 4 migration error notes
View gist:f19543567ed61ac28744


The migration issue has been found and will be fixed in Drafts 4.0.2, which will likely be submitted to Apple on 10/16.

Migration Issue

Some users are reporting an "Import Failed" error trying to migrate drafts to Drafts 4.

It appears some users have some history in their drafts that was not encountered in the beta cycle and is causing an issue with the import. If you would be willing to share your export file for testing, please follow the migration instructions, but select "Email" as the destination instead of "Open in" and send it to

View gist:48c322266ca4fd0ec8bf
// Drafts 4 script step to create custom tags
// using the a line or a default value if that line is empty or missing
// split draft into an array of lines
var lines = draft.content.split('\n');
// reusable function to define tag based on line or default string
function createLineTag(lineNumber,default) {
var tagName = "line"+(lineNumber+1).toString();
if(lines[lineNumber] && lines[lineNumber].length > 0) {
agiletortoise / gist:044d3f20b3f1a94aa2f7
Last active Aug 29, 2015
What's New in Drafts 4 (Quick Draft)
View gist:044d3f20b3f1a94aa2f7

A better list of what's new is now here.

You can’t perform that action at this time.