Skip to content

Instantly share code, notes, and snippets.

@hiilppp
Last active February 8, 2019 13:02
Show Gist options
  • Select an option

  • Save hiilppp/6139407 to your computer and use it in GitHub Desktop.

Select an option

Save hiilppp/6139407 to your computer and use it in GitHub Desktop.
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
Copy Markdown
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