@cvp I thought your solution was good but when the shortcut is run it cannot find the script. I've tried putting the script in various of the Pythonista folders, iCloud, site packages etc.
I presume I need to give the shortcut the full path to the script, and I've tried a few variants but simply cannot get the right path to make the shortcut fire the script.
Ideally I would like to have the script "test.py" in the top iCloud folder, and provide the path to this in the shortcut
Any clues?