Open OneNote with sending a local file
I try to "open in" OneNote, directly without passing by the "open in" menu.
I've found the URL-scheme for that. "onenote:URL of local file".
But when I try with onenote:file:///..... As usual, it is refused.
Do I need to write it in another way?
I don't know the specifics of OneNote's URL scheme support, but It's basically not possible for it to do anything with an absolute file path (regardless of how you format it). iOS apps are sandboxed, and OneNote cannot access any files that are in Pythonista's sandbox. The system-provided "Open in" dialog is basically there to make transferring files from one sandbox to another possible, but you can't do it without showing the dialog.
Thanks for your clarification.
But the "Open In" action of Workflow with only one app does not show the "Open In" menu and OneNote starts with its Share window where you choose in which section you want to send the opened/copied file. If you start OneNote via its URL scheme, you don't have this window...
I've asked to the Workflow support how they are able to have a such process.
Wait and see, and, of course I'll transfer their answer in this topic
If you don't get an answer, and all you want to do is add a PDF to somewhere on OneNote from Pythonista... you could try the OneNote API.
Of course it may not be AS fast...but you could pull a list of sections from the API and choose which one you want with a UI list dialogue or tableview in Pythonista.
Thanks to help me to find a solution.
I think that using an API is to complex for me 😅 and I only want to fall in the first window of the "Open In" OneNote in which you choose where to copy your file, exactly like with Workflow. I have to say that before buying Phthonista, I wrote some workflows and since I bought it, I've rewritten all of them in Pythonista and I don't use Workflow any more, even if I'm no more a good developer (I'm retired for 6 years),
Pretty sure Workflow uses the API, not the url scheme.
Answer from Workflow support:
**I can't speak exactly to how right now, but if you're trying to send a file via the URL scheme, that will not complete. Open In is a system feature, separate from URL schemes, which deal primarily with text and/or the clipboard.
This we are now sure that they don't use URL-scheme (like @jonB idea), I have "insisted" to get an explanation.
Really too complex for me and estonished I should have to login, what is not asked by Workflow. I don't want to open a page and write in it, but only to "open in" OneNote without passing by the standard Open In menu where I could choose OneNote.
Found this : http://www.mattrayls.com/2015/06/10/sharing-an-image-with-instagram-through-uidocumentinteractioncontroller-swift/
Could I get some help to convert in Python?
Thanks by advance