/Pythonista

Various Pythonista Integrations

Primary LanguagePythonApache License 2.0Apache-2.0

Pythonista Utilities

Various iOS Pythonista Integrations I use.

Some of these need to be launched with the WorkFlow app via Action Extensions, so for example you can export a map pin to a WorkFlow extension and have it launch the correct Pythonista script with the pin data as an argument. Pythonista then processes that and can launch other apps in turn.

Useful links:

All this was developed entirely on an iPad, including managing this git repository with:

Sending Apple Maps pins to Google, TomTom, Waze, OpenStreetmap, Omnifocus

In iOS9 Apple changed the Maps export format to a URL and "broke" my location based workflows. I've recreated them here with the help of Pythonista which is a big improvement on the pure WorkFlow scripts I used to have which were getting unwieldy.

These scripts require a WorkFlow Action Extension to forward the url exported by Apple Maps, here is an example of one:

The specific python scripts (named LocationTo...) then process the link and open the required app on the location.

Note that one exception is Here2OF.py which stores the current location as a nicely formatted OmniFocus note with title, address and links. This requires no input since it uses the current location. Thus it can be launched directly without the need for any argument.

WorkFlow for Importing Python scripts from DropBox

Apparently Apple objected to Pythonista's OpenIn... extension so it's gone and we're left messing about with copy and paste to move our scripts about. Pythonista still has the ability to export to DropBox, so this workflow provides the missing DropBox import.

The WorkFlow part lets the user choose a Pythonista script from DropBox, stores the file content on the clipboard then opens the Pythonista import script with the filename as an argument.

Import.py uses the passed filename and clipboard contents to save the file in Pythonista as a script.

As a safety measure it puts "IMPORTED_" on the front of the saved file so you don't accidentally overwrite anything important. It could check for the existence of the file first and just append a numeric suffix if it it already exists. Maybe later...