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 “Run script” action in Automator

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

      In Automator there is now a Pythonista “Run script” action that takes “The name of the script to be run” as its argument. I have tried the name of the script, the Pythonista URL for the script, a fully qualified iCloud path, etc etc etc. Nothing works. If I want to run a Pythonista script “this_folder/foo.py” what do I enter as an argument for the action?

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

        @kenficara try

        MyScript.py?action=run
        
        1 Reply Last reply Reply Quote 0
        • kenficara
          kenficara last edited by

          Thanks, @cvp — I tried that, with or without the query string. I also tried adding root=icloud since that’s where the script is. I tried it prefixed with pythonista:/// per the docs, prefixed with a leading slash, and prefixed with nothing as you show above.

          The script is in an iCloud folder, so I’ve tried:

          /folder/script.py?action=run&root=icloud

          folder/script.py?action=run&root=icloud

          pythonista3:///folder/script.py?action=run&root=icloud

          cvp 2 Replies Last reply Reply Quote 0
          • cvp
            cvp @kenficara last edited by

            @kenficara Sorry, as I don’t use Automator, I can’t help.

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

              ICloud folders are funny, and not a subfolder of pythonista.

              Try having a script in the main path, which you can then use cd or sys.path.insert to add the iCloud path, and maybe runpy or import, etc.

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

                @kenficara As I said, I don't know Automator but I guess it could run a shortcut (of the Shortcuts app) and this shortcut could open an url running a Pythonista script via its url scheme.

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