Skip to content

Instantly share code, notes, and snippets.

@hiilppp hiilppp/sort.py
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

This comment has been minimized.

Copy link
Owner Author

commented Feb 22, 2014

@hiilppp

This comment has been minimized.

Copy link
Owner Author

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
You can’t perform that action at this time.