omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Pythonista and Opening Files in Other Apps

    Pythonista
    2
    3
    3042
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RainmanNoodles
      RainmanNoodles last edited by

      So I have a complex script that takes a web page and turns it into a .epub file. Unfortunately, I can't figure out how to move the .epub file to iBooks.

      First, I figured Pythonista would have the ability to present an Open In popover using one of its custom modules. That's not the case. (Feature request!) ;)

      So barring that option, I tried opening the file in the browser. Unfortunately, I get the following error:

      Error
      An error occurred while loading the page: Frame load interrupted
      

      Normally, if a .epub file is opened in Safari, it presents the option to open it in iBooks or another app. This is the functionality I want. Ideally, Pythonista could present the Open In popover, but until that happens, is there a way to open files like this?

      The code I'm using is:

      fullpath = os.path.join(os.getcwd(),"test.epub")
      webbrowser.open("file://"+fullpath)
      

      Does anyone know how to do this?

      1 Reply Last reply Reply Quote 0
      • stophlong
        stophlong last edited by

        Have you looked at url schemes?

        http://handleopenurl.com/scheme/ibooks

        I use pythonista to launch things in googlechrome://

        webbrowser.open('googlechrome://omz-forums.appspot.com/pythonista')

        Might also try http:// instead of file to see if launching safari helps...

        Stoph

        1 Reply Last reply Reply Quote 0
        • RainmanNoodles
          RainmanNoodles last edited by

          iBooks' URL scheme accepts iTunes store links, but I'm trying to pass in my own generated ePub. Different job.

          Also, you can't just open a link to a file in an external web browser. Launching Safari isn't going to help at all.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors