Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Outliner with drag/drop reordering - part 2
-
@ihf Weird, I just retested now and successfully worked.
With last Watch OS, last Pyto update from today.
Did you reset switch "Open console" off in "run Pyto code" action?Édit: ok even if switch on.
On the watch, after having asked the text to be appended, the shortcut asks if you authorize the shortcut to access to Pyto, I just tried to answer "refuse" in place of "authorize " and from this moment, I have The same problem as you.
I'LL search how to reauthorize...Solved:
IPhone/Settings/Shortcuts/Advanced/Allow Running Scripts ON
-
@cvp no luck. Works fine from phone but same error as before. Pyto was no longer on my watch (seems to have disappeared after I upgraded the phone)
-
@ihf For that, you only have to reinstall Pyto on your Watch, as usual
More: if your normal outlines are in IcloudDrive/Pythonista 3/Outlines/ folder and if you authorize, on the iPhone connected to the Apple Watch, Pyto access to this folder, you can change in the shortcut the line path = '.....' into
path = '/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/Outlines/'
and your Apple Watch shortcut will access normal outlines, no more ones copied into the Shortcuts/Outlines folder. That's a one step forward.
One thing I can't do actually is to know in the shortcut the entire full name of the outline file, with its date-time part, reason for which you have to define it in the shortcut it-self. But I have some hope.😅 -
@cvp I deleted Pyto from my watch and reinstalled it. Now if I try to start it on the watch it immediately ends.
-
@ihf why do you want to start Pyto on the watch? Do you have a Pyto script running on the watch? Or do you mean you start a shortcut running a Pyto code?
-
@cvp I don't want to run anything (right now) in Pyto on the watch but I thought it was odd that it does that. In any case the error that I get when I run the add to outline shortcut from the watch persists.
-
@ihf did you set
IPhone/Settings/Shortcuts/Advanced/Allow Running Scripts ON
On the iPhone connected to the watch -
@cvp Yes, I did.
-
@ihf Is the error still
Could Not “Run Code” This action encountered an error while running on your iPhone
-
@cvp Yes, that is the message.
-
@ihf weird, this message should occur if
IPhone/Settings/Shortcuts/Advanced/Allow Running Scripts
Switch is not ON...I guess that your new iPhone has access to iCloud Drive and that the shortcut is downloaded on your iPhone,not with the cloud symbol.
I also guess that you allowed shortcuts folder to be accessible by Pyto
-
@cvp Wouldn't not work on the iPhone (which it does) if permissions were incorrect?
-
@ihf I suppose you are right. So I don't understand why it does not work on your watch. I guess there is still a configuration setting missing, but which one... Could you compare Pyto settings on your boTh iPhones?
Does the shortcut ask you the text to append?
I just restested on my watch, still ok.
-
@cvp Yes, the Shortcut asks me for text and then for permission ("Allow "AddRowToFixedOutline"to access "Pyto". After I touch "Allow" I get the message "Could Not Run Code -This action encountered an error while running on your iPhone". I only have the iPhone 13 Pro.
-
@ihf I think that I remember that after I had set the
IPhone/Settings/Shortcuts/Advanced/Allow Running Scripts
Switch ON, I have had to power off/on the iPhone. Perhaps you could try. -
@cvp Power cycling the phone did have an effect...no more error message. After getting input and asking for permission, the Shortcut hangs with the progress circle. Progress?
-
@ihf Is the outline file that you want to append already downloaded on your iPhone?
Is the outline folder accessible to Pyto on the iPhone?
@ihf said:
Power cycling the phone did have an effect...no more error message
Don't believe I'm a Pyto specialist but when I meet a problem, Power off/on is always my last try to solve it.
-
@cvp the file name had changed and Pyto was getting a file not found error. I changed he file name in the shortcut and now it works on the iPhone but fails again with the same message as beore when run from the watch.
-
@ihf Weird and, sincerely, it seems too complex for me.
Anyway, problem of file name would arrive, that's sure. I know this problem and I have already thought about a way to avoid it. The outline.py script could store in the 2022 event of file its full name and the shortcut could ask to choose an outline file like in the viewer shortcut, by listing all files found as 2022 events.
But, a thing that the shortcut nor the Pyto code couldn't do (I think) is, when you modify a file, save it as a new date-time name and modify the .prm with the new file name. That seems too much for a shortcut. -
@ihf
Is it really important for you to be able to append a text to any outline on your watch?
I don't understand how Apple still allows applications to be sold that haven't received updates for a very long time. Good for developers, but buyers take the risk of not profiting from their purchase for long. For me, Pythonista is the best app I have used, which is worth a lot more than its price and for which I would gladly agree to pay an annual subscription of 10 €, even without any updates, just so as not to see it one day disappear or no longer be functional. To be prepared if this disaster ever happens, I imagined converting outline.py to Pyto, but it would be long and not that easy. Indeed, any development in Pythonista also uses modules, like dialogs, which are not available in Pyto and which should therefore be rewritten. To give it a try, I converted SetTextFieldPad.py which is only 134 lines long and already there I encountered differences between the methods of the two UIs and the way to use ObjectiveC, differences that require spending time in searches and tests. If you are interested, try this little script in Pyto
You can even test this very little outline.py that only shows the buttons of the main screen, with these small functionalities:
- files menu, only to test a TableView and a shield
- open to test the Pyto file picker
- font size to test the SetTextFieldPad converted module
- Pyto color picker
- Pyto font picker
Thé script has only 300 lines, thus you can be sure it does nothing. It was only to have an idea of how complex a conversion would be. And I could only be motivated to do this heavy conversion if Pythonista was planned to disappear, and, of course, if you still use this script.
Anyway, I wish you a pretty year 2022 with full Pyt(h)o(nista) projects.