Open App/Open In (specific App)
I'm looking for a way to open other apps with Pythonista. I'm aware of webbrowser.open('appurl://') but this doesn't help with apps which don't have an URL-scheme.
And how can I specify the app a file is opened in? console.openin() opens a pop up but I would like to skip that and directly open the file in an app.
Thanks in advance :)
What app are you trying for? A great many apps have url schemes.
I tried to open the photos app with Pythonista. As I found 'photos-redirect://' this isn't a problem anymore.
The problem that still is present is that I create a pdf with Pythonista (got a nice script here in the forum). The created pdf then should be opened in GoodNotes which I use for viewing, annotate, highlighting et cetera. To achieve this I can use "console.open_in(file)' and then manually select GoodNotes.
With another app I own (Workflow) it is possible to tell the iOS' Open In... popup what app is chosen. Just questioning myself if this isn't somehow possible with Pythonista too :)
then run python ios-url-scheme-extractor.py
Select the app, and it should populate with the url scheme.
Basically, many, if not all, apps have a url scheme, even if not published.
I suspect GoodNotes has one (or had one, as of version 4.4)... it is a sort of random set of characters:
I suspect that app has DropBox integration, hence the db prefix. This could be version dependent.
The trick will be figuring out a way to launch the app WITH an attachment.... which might be impossible without using something like ctypes. You could first upload to dropbox, then launch GoodNotes, and use its dropbox integration to download it from dropbox... not ideal but an option
Thanks for the help.
The workaround with upload to Dropbox and the import within GoodNotes is a nice idea but I'm not sure if the default "open in"-dialogue isn't easier.
Show the iOS “Open in...” menu for the specified file.
If an application was selected in the menu, its bundle identifier will be returned (for example 'com.getdropbox.Dropbox'). If the menu was cancelled, or no application is installed that can open the file, the return value is None.
With this I can open the file but have to choose the app. I'm searching for a way to skip the dialogue and set the chosen bundle identifier in the script.
I would guess that the Workflow app also uses URL schemes for skipping the "Open in..." menu internally. It looks like it's only supported for certain apps, and I'm pretty sure that there is no other public API to achieve this otherwise.
I goaded Remember The Milk (RTM) in this blog post a few days ago - for not having a URL scheme:
They seemed initially to have responded positively.
Workflow, as an orchestrator, was one I had in mind. Editorial or Pythonista are both more sophisticated orchestrators (for the fiddlier stuff I'd actually throw into Production).
But RTM would not be the only app that needs work to advance into the modern world.