Skip to content

Instantly share code, notes, and snippets.

@hiilppp
Last active Feb 8, 2019
Embed
What would you like to do?
Python script to sort lines of text in Pythonista and send them (back) to Drafts.
# To call script from Drafts, use the follwing URL as URL Action:
# <pythonista://sort?action=run&argv=[[draft]]>
import sys
import urllib
import webbrowser
a = sys.argv[1].split("\n")
a.sort(key=str.lower)
a = "\n".join(a)
webbrowser.open("drafts://x-callback-url/create?text=" + urllib.quote(a))
@hiilppp
Copy link
Author

hiilppp commented Feb 22, 2014

@hiilppp
Copy link
Author

hiilppp commented Apr 22, 2014

Cf. list.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment