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.
Issues opening textastic to view source
-
Am I missing something here? It is not opening the textastic app.
# coding: utf-8 import appex import webbrowser from urlparse import urlsplit def main(): if not appex.is_running_extension(): print 'This script is intended to be run from the sharing extension.' return url = appex.get_url() if not url: print 'No input URL found.' return url = urlsplit(url) url = 'textastic://' + url.netloc + url.path + url.query + url.fragment print url webbrowser.open(url) if __name__ == '__main__': main()
-
@miwagner1 Could you post the typical output of the
print
statement, please? -
share app extensions cannot launch other apps. Only Today Widgets. Its an Apple thing.
-
Marcus67 the typical output looks like
textastic://forum.omz-software.com/topic/2616/can-pythonista-push-itself-into-the-foreground
Well dam if an extension can't open an app, I'm going to have to get fancy for viewing source code.
-
Ok so workflow can open other apps from the app extension. The user just had to confirm it. So how would I do this from the pythonista extension?
-
I think workflow has a today extension? so maybe that's it?
Alternatively, you could post anotification
. If you set pythonista notifications to alerts instead of banners, then younwould effectively get prompted to open the app. -
scratch that... this does work
import appex from objc_util import * app=UIApplication.sharedApplication() url=nsurl('pythonista://') app.openURL_(url) appex.finish() #optional to close appex in containing spp, otherwise it will be there when you return.
-
@JonB Nice one! Didn't know that was possible.
-
based on this... except that when I walked up the responder chain it turned out to be the sharedApplication()
-
This is fantastic. There are so many possibilities I can do now with pythonista and editorial with webpages. Right in the safari app.
-
-
No wonder he was surprised it worked. Apples docs say the UIApplication is Not available in app extensions.
It's possible this will break in later iOS versions.