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
-
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
-
You can use the
webbrowser
module toopen
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. -
I think you are looking for something like this?
-
@hyshai, @JonB: Not sure if I understand the
x-callback-url
scheme properly, but I hoped that ax-source
parameter would do it. I guess I have to implement that in pythonista myself... -
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.