Clear & Pythonista

Hello! I wrote an improved version of this workflow. You can find it here.

You love Clear and you love URL schemes, but you definitely hate whatever is on the deeper layers of your keyboard. Specially commas. And Clear needs those to send more than a single task to a list. It bothers me so badly I moved to Ita. However, now with Pythonista, I can use Clear again.

This trick is absurdly simple and I must thank Eric Pramono for cleaning up my dirty python code. But first we're going to add a little action to Drafts to send the contents of the doc to Pythonista.

Tasks to Clear:

pythonista://Commas2Clear?action=run&args=[[draft]]

Super simple, right? This action will send your current draft to Pythonista and run the workflow Commas2Clear.

from urllib import quote
from webbrowser import open
a = sys.argv[1].split('\n')
clear = 'clearapp://list/create?listName=' + quote(a[0]) + '&tasks=' + quote(', '.join(x for x in a[1:])) 
 open(clear)

This is it. This rule will parse the first line of your draft as the name of the list, meaning that you can create or append to any list. The remaining items will be comma-separated and added to the aforementioned list.