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 | Add Scripts to Pythonista from Gists

Add Scripts to Pythonista from Gists

Every time I share a Python script I do via Github gists, they're easy to maintain and are created directly from Pythonista. I used an script by Ole Zorn, the developer of Editorial and Pythonista, to create scripts from gist links in my clipboard. Pythonista 2.0 got an action extension and I thought it would be a great idea to improve such essential utility.

The script has the same limitations as the original, only working on single-files with the .py extension hosted as Github Gists. The original version opens the script after creation with the editor module, which is unavailable from the extension, so we display a HUD alert confirming the script was added successfully.

Further changes in the process to handle conflicts in the file name: the original script would append a suffix and create a new file, meanwhile the new version prompts to rename or replace the file. I did this because the suffix behavior is default of the command ran from the editor module, unaccessible from the extension, so this is supposed to streamline the experience across the multiple contexts where this utility is accessible.

Time for the last Pythonista gist you'll ever need to copy and paste in the app.

New from Gist

Adds Python gists as scripts on Pythonista. Based on Ole Zorn original action to support the new action extension.

View Script

At first the script won't show in the extension, so while at the extension tap the Edit button in the top-left corner. You got a button with a plus sign after the default scripts, tap it and you'll go to the Script Library to pick the script you want to add. After selecting it you can edit the entry, change title, set arguments and tweak the icon. Then you're set.

You can find some Pythonista scripts to put the script at test in the Actions page, including the script to OCR business cards for Interact.