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.


    Access to the standard iOS Files sheet?

    Pythonista
    ios files
    3
    16
    9355
    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.
    • shinyformica
      shinyformica last edited by

      Is there a way to get access to the standard iOS Files sheet to select a file or folder from accessible locations?

      I did a couple searches of the forum, but couldn't find a post about this, or anything obvious in the Pythonista libraries included with the app.

      Perhaps someone has some objc_util code that can do it?

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

        @shinyformica Not sure I correctly understand, try this

        import dialogs
        f = dialogs.pick_document(types=['public.item'])
        
        1 Reply Last reply Reply Quote 0
        • shinyformica
          shinyformica last edited by

          You in no way misunderstood...and that looks like it might be exactly what I'm after. However, in my defense, that function is not documented in the docs for the dialogs module, which is where I first looked for just such an offering:

          http://omz-software.com/pythonista/docs/ios/dialogs.html

          But thanks for pointing me to it...I think I need to start looking at the module source before asking.

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

            @shinyformica you're right. The on-line doc is not really up to date.
            You have to use the in-app doc, by selecting a word (fi "dialogs") and tap on help.

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

              @cvp thanks to you mentioning the pick_document() function, I was able to search the pythonista forum for that, and found this thread, which was informative:

              https://forum.omz-software.com/topic/4815/dialogs-pick_document-with-custom-file-extensions/

              That thread mentions "The internal pythonista documentation", which apparently has docs on things that might not be documented on the website? Where are the internal docs? Doing help(dialogs.pick_document) doesn't show anything useful in the console...I'm missing something, I'm sure.

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

                @shinyformica

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

                  @cvp ha! You answered my question before I even asked it.

                  I'll do that first from now on. Thanks.

                  Ok, question #2, since I have you here...I'm looking over the UTI (what a poor choice of acronym...Apple) documentation and I'm not sure I see how to specify selecting a folder instead of a file...is it "public.folder"?

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

                    @shinyformica UTI not from Apple, I think
                    Never seen about folders, see here

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

                      @cvp it's an Apple-invented standard, as far as I know (https://en.wikipedia.org/wiki/Uniform_Type_Identifier)...so they are to blame for the Urinary Tract Infection...I mean Uniform Type Identifiers :)

                      That link is where I went to try and find the type to provide for folders...I tried both "public.directory" and "public.folder" but neither works...the files sheet shows up, but it doesn't let you select a folder.

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

                        @shinyformica it's sure that pick_document allows to pick a file, not a folder.
                        What do you want to do?

                        Even the UIDocumentPickerViewController only gets one document

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

                          If you don't need to do it programmatically, you could use Edit from the file menu, select a folder, then use the share button in the folder menu. Might not work with all apps...

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

                            @JonB That only works for folders inside Pythonista, not for folders in the Files app, isn't it?

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

                              Right.. if you are trying to share FROM files, I'd think you would need to go through the extension, and appex.get_url, but now sure how that ends up working.

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

                                @JonB I think @shinyformica wants to pick a folder in the Files app...

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

                                  You can launch the Files app and Pythonista in split view, and drag a folder of the Files app and drop it into Pythonista. The folder will be copied.

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

                                    @JonB @cvp

                                    First, thanks for both responding!
                                    To answer the questions you both bring up:

                                    1. It does need to be done programmatically, this is for picking a folder from within a running UI.

                                    2. The Files sheet UI definitely seems to be able to pick a folder...at least, I've seen other apps use it for that purpose. Even pythonista itself can select a folder from the Files sheet for import and other things.

                                    If it's just that pick_document() is restricted to only picking files, and cannot pick folders, that's what I'd want to know.

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