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.


    Help on url scheme, qr codes

    Pythonista
    3
    6
    3367
    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.
    • jbap
      jbap last edited by

      Hello, I am looking to run separate Pythonista scripts from a qr code. I was using the url scheme, but realized that Pythonista couldn't close the program in time to open the other. Pythonista apparently can only run one program at a time. Can somebody help me out on this?

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

        Yes, Pythonista can only run one script at a time. If you wrote the scripts yourself, you could make a single script that runs multiple scripts in sequence. Otherwise I have no idea how you want to run multiple scripts with the URL scheme, it only takes a single script name...

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

          You might try having your script spawn a Thread to run the script, so that the "running" script exits immediately. I have not tried this approach, but when running stash, I believe it is still possible to run other scripts via the url scheme

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

            @JonB UI scripts are less of a problem no matter if you use threads or not. Once the script is done with the "setup" phase and the root view is presented, the script (normally) exits and no code is run until the user triggers an action or delegate method. The only issue is if you then run another script, the globals are cleared, and any actions and delegates relying on old globals will no longer work.

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

              Rereading the question, I guess the OP wanted one QR code to spawn multiple scripts? If so, I agree the way to go seems to be one "launcher" script. Note that you can pass argv arguments via the url scheme, so it would be possible to pass in sequences of argvs that tell the launcher script what to do.

              Not sure if there is a limit on the number of args.

              1 Reply Last reply Reply Quote 1
              • jbap
                jbap last edited by

                You know what, never mind. I was using OMZ's Barcode/QR Code Scanner that uses ui. I just had to use the wait_modal function. Sorry!

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