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.


    Returning to calling app after URL scheme call

    Pythonista
    3
    5
    2761
    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.
    • halloleo235
      halloleo235 last edited by

      Hi there

      I have a script doing some text conversion in the clipboard. I call the script via the pythonista:// URL scheme.

      After running the script from say iCabMobile or Drafts, ptyhonista stays open, but I would like automatically to return to the calling app. How is this possible?

      Many thanks, Leo

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

        You can use the webbrowser module to open a url (including url schemes).
        Though I don't think you're able to see which was the calling app (iOS limitation) to dynamically call that app.

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

          I think you are looking for something like this?

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

            @hyshai, @JonB: Not sure if I understand the x-callback-url scheme properly, but I hoped that a x-source parameter would do it. I guess I have to implement that in pythonista myself...

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

              You can pass arguments to pythonista using args, or argv parameters.

              So while pythonista does not directly support x-callback-url directly, you can do everything you want with arguments. So, you could pass the source, or callback url, etc as arguments to your functions. You could one for success, or for failure, etc. of course, if you only have one app that needs the function, it may be easier to hardcode in the script.

              See
              urlscheme in the docs.

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