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 ok, and now, do we agree that contacts is the best way?
-
@cvp The only problem I see is if I (or anyone using the script) shares their contacts as part of their connection to some other service. It may not be desirable to share the content of these outlines. I tend to avoid sharing contacts but it occurred to me that having the outline information in there could conceivably be problematic. DataJar would not have that privacy consideration.
-
@ihf Wow. Not thought about this privacy. Found the posts but problem was to run a shortcut at each outline update. Reason why we did prefer calendar event. Remember that we do this process only for Apple Watch...
-
@cvp Data Jar lets you store any files and quickly retrieve them in Shortcuts. It is a very useful app.
-
@ihf ok, I understand but that will say update this iCloud file at each outline update
And did you try to read a DataJar on Watch? -
@cvp yes, I use Data Jar to retrieve images, sound and text files all to the Watch.
-
@cvp I don’t know if this is possible, but if Pythonista can write the data to the Data Jar directory in iCloud then it will be accessible to a shortcut using Data Jar.
-
@ihf Ok, do you want we try to go in this direction? If yes, perhaps not before my vacations and you will have to describe your request. Only one file? Multiple records, one per outline? Key=outline title, data=outline file?
-
@ihf said
but if Pythonista can write the data to the Data Jar directory in iCloud
We will fall one more time with iCloud problems when updating an iCloud file, remember multiple versions with a number in the file. I guess it is better to always use only one file which should be a big dictionary of your outlines .
-
@cvp The way I imagine it (which may not necessarily be the best way) is for each Outline to be a key value pair in Data Jar. A key being the outline name And the value being its content.
-
@ihf then, it is necessary to pass via a shortcut to use DataJar app with its risks and without checking if process has been done
-
@cvp yes, the Calendar is better except that it doesn’t work.
-
@ihf
please read entire post, covers several subjects
I have thought to the fact that it works on my Apple Watch. I told you that I had done some tests with 2022 June 01 before I develop 2042 January 1.
The events of June 2022 do not exist any more but a search on my iPhone shows them. And perhaps the shortcut on Apple Watch shows them also and not the real ones of 2122...But anyway, do you really share all your contacts? Just to be sure we forget this solution.
Or do you prefer something like this (automatically done by a little shortcut which scans my 2042 events).
-
@cvp I think that using Data Jar is preferable . You asked ifI share all of my contacts. I try not to but many platforms ask you to and it would be easy to slip. I presume that there is no way for Pythonista to write a file into the iCloud/DataJar folder thereby obviating the need for a shortcut to be run each time an Outline is changed?
-
@ihf I think that if we write ourselves an iCloud file we will meet new problems thus the best solution will be to run a quick shortcut which will add/update a key/value pair at store level (if you agree).
I have not yet updated outline.py, perhaps tomorrow if you agree this way.
Anyway, here is a shortcut to run only once to create a DataJar key/value for each 2042 event.
And here is a shortcut to get all keys, select one and display the value, also working on Apple Wach
Try them without danger
-
@cvp The Shortcuts worked as expected.
-
@ihf Ok, I stop for today but tomorrow, I'll modify outline.py to update the DataJar via a started shortcut but I'll not yet remove the 2042 event update to be sure at least one thing works.
Thus, hear you tomorrowbut first of all, is this solution ok for you: key/value at DataJar store level?
-
@ihf it is obvious that Outline.py could also manage a keyed file in iCloud Drive like DataJar but you know problems we have had when an iCloud file was not downloaded locally and that we had to assure it was first downloaded before its update... Thus if this app takes care of this problem itself, it is good for me.
-
@ihf Please install shortcut Clipboard_to_DataJar
before installing new version
of outline.pyThen, install V01.36 and outline.versions with
Version V01.36 - in addition to save outline in calendar event on 01 January 2042, copy outline¥content in clipboard and run Clipboard_to_DataJar shortcut to also save outline in DataJar store as pair key=outline name value=outline content
And test, of course. You will see that saving an outline will run a shortcut then comes back to script.
Saving also as 2042 event is still active, I'll remove this code when you decide that DataJar is the right solution.
I advice to not set an automatic save which is too frequent -
@cvp I ran Outline and saved a modified outline. The script ran the Shortcut and hung Shortcuts and after a minute or 2 crashed Shortcuts. I found that the Data Jar beta had expired so I reinstalled it and verified it works and that my outlines are there.
However, when I run the Outlines as DataJar, the newly modified Outline is not present (even after several minutes). I guess it takes awhile for it to show up? Also, the Shortcut lists all my Data Jar contents, not just the outlines.Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/228D1F3E-E592-4896-BBF5-D6EA74943D0D/Pythonista3/Documents/outline.py", line 3321, in tableview_cell_for_row
v = MyInputAccessoryView(row)
File "/private/var/mobile/Containers/Shared/AppGroup/228D1F3E-E592-4896-BBF5-D6EA74943D0D/Pythonista3/Documents/outline.py", line 503, in init
self.width = mv.get_screen_size()[0] # width of keyboard = screen
File "/private/var/mobile/Containers/Shared/AppGroup/228D1F3E-E592-4896-BBF5-D6EA74943D0D/Pythonista3/Documents/outline.py", line 1168, in get_screen_size
for window in UIApplication.sharedApplication().windows():
File "/var/containers/Bundle/Application/F461CDE3-9B4B-426C-8867-7562C21CF685/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 801, in call
ordered_args = list(args) + [kwargs[key] for key in kwarg_order]
TypeError: 'builtin_function_or_method' object is not iterable