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.


    Is it possible to run external file scripts from Shortcuts?

    Pythonista
    4
    5
    1779
    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.
    • DavidFernas
      DavidFernas last edited by DavidFernas

      This post is deleted!
      cvp 1 Reply Last reply Reply Quote 0
      • cvp
        cvp @DavidFernas last edited by ccc

        You could, via Shortcuts, launch a little Pythonista script running in Python2
        and launching it-self your external file script in Pythonista3

        Tested and ok:

        #!python2
        from objc_util import *
        dir = '/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/.../xxx.py'
        arg = ''
        #dir = os.path.expanduser('~/Documents/'+app)		
        I3=ObjCClass('PYK3Interpreter').sharedInterpreter()
        # run a script like in wrench menu (path, args, reset env yes/no)
        I3.runScriptAtPath_argv_resetEnvironment_(dir, [arg], True) 
        
        1 Reply Last reply Reply Quote 0
        • cvp
          cvp last edited by

          I'm (almost) sure you could even pass the external script url as argument of little script, not tried

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

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • flisterfour
              flisterfour last edited by flisterfour

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors