Skip to content

Instantly share code, notes, and snippets.

@drdrang
Last active December 31, 2015 21:49
Show Gist options
  • Save drdrang/8049698 to your computer and use it in GitHub Desktop.
Save drdrang/8049698 to your computer and use it in GitHub Desktop.
Pythonista script for s̸t̸r̸i̸k̸i̸n̸g̸ ̸o̸u̸t̸ text sent to it from Drafts and sending it back.
import sys
import webbrowser
import urllib
unstruck = sys.argv[1]
struck = []
for c in unstruck:
struck.append(c)
if c not in ' \t\n':
struck.append(u'\u0338')
struck = ''.join(struck)
# To call script from Drafts, use the following URL as URL Action:
# <pythonista://Strikeout?action=run&argv=[[draft]]>
webbrowser.open("drafts://x-callback-url/create?text=" + urllib.quote(struck.encode('utf-8')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment