omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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

    Pythonista
    9
    589
    180611
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cvp
      cvp @ihf last edited by cvp

      @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 tomorrow

      but first of all, is this solution ok for you: key/value at DataJar store level?

      1 Reply Last reply Reply Quote 0
      • cvp
        cvp @ihf last edited by

        @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.

        1 Reply Last reply Reply Quote 0
        • cvp
          cvp @ihf last edited by cvp

          @ihf Please install shortcut Clipboard_to_DataJar before installing new version of outline.py

          Then, 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

          1 Reply Last reply Reply Quote 0
          • ihf
            ihf last edited by

            @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

            cvp 1 Reply Last reply Reply Quote 0
            • cvp
              cvp @ihf last edited by cvp

              @ihf sorry but I don't really understand what you said and why do you post a traceback while you don't describe any script crash, only shortcuts crash

              You said

              Also, the Shortcut lists all my Data Jar contents, not just the outlines.

              Which shortcut do you run? This one ?

              Édit: you're right, my DataJar only contains outlines, thus....
              how could we distinguish them? Or we could not add them at store level but a lower level?
              Up to you to tell me, I didn't even know DataJar until yesterday

              Ok, I've a solution: create an entry "Oulines" at store level and store there pairs outlin_name/content

              Agree? If yes, I'have to change all, tell me quickly, almost gone away

              1 Reply Last reply Reply Quote 0
              • ihf
                ihf last edited by

                @cvp Sorry about the traceback, I first got a Pythonista error but restarting it cleared it. In regard to Data Jar, I believe that the Outlines could be one key and that key can have values such as lists or dictionaries. The dictionary (or list) could presumably hold each separate outline. However, a bigger problem is that the modified outline has yet to show up on the Watch (it shows up on 2 iPads so it must be on iCloud).

                cvp 3 Replies Last reply Reply Quote 0
                • cvp
                  cvp @ihf last edited by

                  @ihf check my previous post please, update while you typed

                  1 Reply Last reply Reply Quote 0
                  • cvp
                    cvp @ihf last edited by cvp

                    @ihf said

                    However, a bigger problem is that the modified outline has yet to show up on the Watch (it shows up on 2 iPads so it must be on iCloud).

                    I ask me if I didn't start DataJar on iPhone before?

                    Perhaps, you have to run DataJar on your iPhone to force the download of the iCloud file

                    1 Reply Last reply Reply Quote 0
                    • cvp
                      cvp @ihf last edited by

                      @ihf Even if I can have a shortcut action "set Outlines.name outline_content", thus at level lower than top level of DataJar, I don't find an action to get list of keys of this Outlines level

                      1 Reply Last reply Reply Quote 0
                      • ihf
                        ihf last edited by

                        @cvp What happens if you have a key in Data Jar that in turn has a value of a dictionary and the key values in the dictionary are the Outline names with their content. Then the shortcut to get a value based on key from Data Jar would get you the dictionary and the shortcut to get values from a dictionary would get you the outline text. Would that work?

                        cvp 1 Reply Last reply Reply Quote 0
                        • cvp
                          cvp @ihf last edited by cvp

                          @ihf Not sure I understand your question but I have solved I think to have a dictionary named Outlines at store level and dictionary contains pairs key=name value=data.

                          Outline.py will stay the same but the 3 shortcuts need to be updated.

                          First, Clean manually your outlines in your DataJar

                          1. the shortcut to run only once Outlines 2042 Events to DataJar

                          Run it and check your DataJar

                          1. the shortcut to select an outline and display its content, even on Apple Watch

                          Outlines as DataJar

                          1. the shortcut executed by outline.py

                          Clipboard_to_DataJar

                          1 Reply Last reply Reply Quote 0
                          • ihf
                            ihf last edited by

                            @cvp It works! Thank you!

                            cvp 1 Reply Last reply Reply Quote 0
                            • cvp
                              cvp @ihf last edited by

                              @ihf so i deserved my vacation 😀

                              1 Reply Last reply Reply Quote 0
                              • ihf
                                ihf last edited by

                                @cvp many times over :-)

                                cvp 1 Reply Last reply Reply Quote 0
                                • cvp
                                  cvp @ihf last edited by cvp

                                  @ihf please note that I've been obliged to run DataJar on my iPhone to see the outlines on my watch. Not sure it will always be so

                                  Tell me when you want I comment/remove the code to store also the outlines as 2042 event

                                  1 Reply Last reply Reply Quote 0
                                  • ihf
                                    ihf last edited by

                                    @cvp I am using the latest version which is running the shortcut properly. I have an outline with a blank item at the end and if I try to delete it through the menu “delete with children” it hangs the program.

                                    cvp 3 Replies Last reply Reply Quote 0
                                    • cvp
                                      cvp @ihf last edited by cvp

                                      @ihf I just try the same without problem.

                                      But, from last iOS update, I meet sometimes some hangs, even when starting the script.
                                      Removing Pythonista from memory does not solve the problem but rebooting the iPad does the job.
                                      Don't ask me why. I guess that without any Pythonista update, we will meet this kind of problem more frequently.

                                      1 Reply Last reply Reply Quote 0
                                      • cvp
                                        cvp @ihf last edited by

                                        @ihf We have got a lot of crashes but never, as I remember, hangs. Is it reproducible after the reboot of the iDevice ?

                                        1 Reply Last reply Reply Quote 0
                                        • cvp
                                          cvp @ihf last edited by

                                          @ihf said

                                          I have an outline with a blank item at the end and if I try to delete it through the menu “delete with children” it hangs the program.

                                          Did you retry after a reboot of the iPad?

                                          1 Reply Last reply Reply Quote 0
                                          • ihf
                                            ihf last edited by

                                            @cvp It appears to be working now.

                                            cvp 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors