Deprecated: Return type of I::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 62

Deprecated: Return type of I::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 91

Deprecated: Return type of I::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 71

Deprecated: Return type of I::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 101

Deprecated: Return type of I::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 53

Deprecated: Return type of Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/collection.php on line 80

Deprecated: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in /home/public/kirby/toolkit/lib/url.php on line 135
One Tap Less | Listacular & Pythonista - Update

Listacular & Pythonista - Update

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

At the end of my previous article, a few hours ago, I said that you could use the first line as the title of your plain text file and hyphenate the remaining items. This is how you do it (also, I found out a shorter way to do the last code, cutting down one loop, yay). Thank you Eric for cutting it down to almost a tweet.

from urllib import quote
from webbrowser import open

list = sys.argv[1].splitlines()

result = list[0] + '\n' + ("\n".join(('- ' + x) for x in list[1:]))

encoded = quote(result)

drafts = 'drafts://x-callback-url/create?text=' + encoded + '&action=Pytho-Groceries'

open(drafts)

I won't explain much, name this rule on Pythonista as Convert2Listacular and also install these 2 following actions on Drafts. Due to limitations of Drafts and my laziness to explore the dropbox module at Pythonista, you can only create files using the First Line as a parameter for its title. You cannot append or prepend items to an existing list.

Convert to Listacular:

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

And Pytho-Groceries, which is a Dropbox action. If you had downloaded these actions from the previous article, there's no need to do it again.

This is all Pythonista for the day. Next I'll try to get rid of those damn commas required to add more than a single task to a list in Clear. Wish me luck!