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.
Send URL from extension to Editorial.app
-
I want to send a URL from an extension to a document in Editorial.app. When I run the script in pythonista it works, but if I run it from the extension it doesn't.
import appex import requests import webbrowser import clipboard import console def main(): if not appex.is_running_extension(): url = "www.example.com" else: url = appex.get_url() if url: clipboard.set(url) # Editorial.app will use the clipboard and paste it at the end of a document webbrowser.open('editorial://x-callback-url/open/path-to-file.txt?root=dropbox&command=PasteLink&x-success=pythonista://') else: print 'No input URL found.' if __name__ == '__main__': main()
I tested it a bit more and it seems that the
webbrowser.open()
doesn't work in the extension. Is there a other solution to send the URL? -
This is an apple restriction. Use:
from objc_util import * app=UIApplication.sharedApplication() url=nsurl('editorial://') app._openURL_(url)
-
Thanks, didn't know that. It now works!