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.


    Sending arguments from Shortcuts to Pythonista not working

    Pythonista
    6
    10
    10136
    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.
    • michaelmincone
      michaelmincone last edited by ccc

      https://imgur.com/a/aYvbSLC

      Does anyone have an idea as to why this isn't working and how I can fix it? Any help is greatly appreciated

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

        On the leftmost panel, should "Hello" be in quotes?

        cvp 1 Reply Last reply Reply Quote 0
        • cvp
          cvp @ccc last edited by

          @ccc Same problem with "Hello"

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

            Workaround, your shortcut could be

            URL = pythonista3://test.py?action=run&args=Hello 
            Open URL
            

            and that works as expected

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

              I am experiencing the same problem.
              When using the URL workaround, is there a limitation to the size of the argument?

              cvp 1 Reply Last reply Reply Quote 0
              • cvp
                cvp @shiranc last edited by

                @shiranc I don't see why it could be a limit but don't forget this is an url...

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

                  Thanks! @cvp

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

                    I’m trying to pass a list of arguments (which worked before iOS 13). How would I do this with a URL?

                    My list looks like this:

                    A=Hello
                    B=foo

                    Pythonista would see sys.argv(1) = “A=Hello”. Sys.argv(2)=“B=foo”

                    Any ideas?

                    cvp 1 Reply Last reply Reply Quote 0
                    • cvp
                      cvp @msperlin last edited by cvp

                      @msperlin see the doc in the App (console / ? / using Pythonista / url scheme)

                      pythonista://MyScript?action=run&args=foo%20bar 
                      

                      When you pass a single string with the args URL parameter, the string is split by spaces (the space is encoded as %20 here) and sys.argv would be [<script_path>, 'foo', 'bar'] in this example.

                      1 Reply Last reply Reply Quote 0
                      • a.idy
                        a.idy last edited by

                        Hi,

                        Does anyone know why we need a workaround? Did the recent new version of iOS break Shortcuts being able to run Pythonista scripts directly?

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