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 The best way to test it is first to test the shortcut on your iDevice before testing on Watch.
Then, in the action "run Pyto code", set "open console" switch ON.
Of course, Pyto has to be installed on your Watch -
@cvp I had .outline on the filename in the shortcut. I removed it and now pyto says:
Traceback (most recent call last): File "Library/Caches/Shortcuts.py", line 89 , in <module> with open(path+file,mode='rt', encoding=' utf-8', errors="surrogateescape") as filc: PermissionError: [Errno 1] Operation not perm itted: '/private/var/mobile/Library/Mobile Do cuments/iCloud~is~workflow~my~workflows/Docum ents/Outlines/ToDo_20211221_171407.outline' Exception in thread Thread-5: Traceback (most recent call last): >>> File "Library/python38/threading.py", l ine 932, in _bootstrap_inner self.run() File "Pyto.app/scripts_runner.py", line 51, in run super().run() File "Library/python38/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "<string>", line 18, in complete File "Pyto.app/Lib/rubicon/objc/api.py", li ne 651, in __getattr__ raise AttributeError( AttributeError: rubicon.objc.api.ObjCClass Py to.EditorViewController has no attribute code ToComplete ```
-
@ihf you are sure that
Outlines/ToDo_20211221_171407.outline
Exists in iCloudDrive/ShortcutsAnd you have to define Shortcuts in the accessible folders of Pyto
-
@cvp I added the Outlines directory in Shortcuts to the pyto accessible directories. I then ran the Shortcut on my iPad and the pyto script seemed to run without error. However, when I then run outline, change the path to the outlines in Shortcuts dir, and open the outline, I get “File does not (yet) exist, try again”.
-
@ihf You have also to authorize Pythonista to access iCloudDrive/Shortcuts folder in "external files/open/folder"
-
@cvp got it working from the phone but watch says
Could Not “Run Code” This action encountered an error while running on your iPhone
-
@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.