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.


    appex loads code from icloud

    Pythonista
    3
    9
    3365
    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.
    • oliep
      oliep last edited by

      As far as I understand it is not possible to run an appex that lives inside the icloud folder. So I came to the idea of having a tiny appex wrapper script local that loads the main program from the icloud folder. The following code kinda works (not really):

      sys.path.append('/privat/var/mobile/Library/Mobile Documents/iCloud~com~omz~software~Pythonista3')
      from Documents import TheMainCode
      TheMainCode.doSomething()

      But it has some nasty side effects. For example changing anything in the icloud file only has effect on the iOS device after a complete restart. And some variables seem to survive subsequent calls. Can someone please help me to understand what's happening here and if there is a working way of programmatically importing code from icloud?

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

        @oliep if via share/Pythonista3/edit scripts you don't receive this

        It will appear in next version (I've the beta, thus no more able to test App Store version)

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

          @oliep was a bug in actual version see here

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

            @oliep If you want to share text to a Pythonista script, even on iCloud, you could write a shortcut in the IOS Shortcuts app which will be shared and will receive as "Shortcut input" the shared text.
            Your shortcut could then open url pythonista://your script.py?action=run&root=icloud&args=ShortcutInput Magic variable.

            See shortcut

            Of course, instead of sharing to Pythonista, you will have to share to your shortcut.
            That's while waiting for the new version of Pythonista.

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

              @cvp Perfect! Thanks a lot!

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

                @oliep sadly, this solution does not work for a file sharing, only for text sharing

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

                  @cvp Oh yeah. I've just figured that. To bad. The bug/missing feature in workflow is already a year old. Bummer. Let's hope for the best.

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

                    @oliep The beta version contains the feature, if you need it urgently, ask @omz to be part of the test.

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

                      The beta signup link is
                      https://testflight.apple.com/join/qDkBu2ur

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