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.


    Can't make shortcut icons.

    Pythonista
    8
    16
    5996
    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.
    • shinya.ta
      shinya.ta last edited by

      Once version upgrade is done on iOS 13, you can't make a shortcut of a script of Pythonisa on the home screen.
      Is this a bug? Is there any change in the way?

      1 Reply Last reply Reply Quote 0
      • shinya.ta
        shinya.ta last edited by

        If you restart the icon that you made once, nothing will be displayed.

        cvp 1 Reply Last reply Reply Quote 0
        • cvp
          cvp @shinya.ta last edited by cvp

          @shinya.ta In reality, the problem is more complex, I think. With IOS13 and Pythonista beta 330014 (and perhaps also with standard and last beta versions), the icon shortcut starts your script two times at almost the same moment and if your script does not check if it already is running, it locks or crashes or... depending on the script process.

          I have opened an issue here

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

            The best way now, I think, to create a shortcut icon on the home screen to start a Pythonista script is to create a shortcut in the Apple standard Shortcuts App with only one command,
            "Execute Pythonista" and giving it the script folder and name.
            Then tap "on home screen" where you can define the text and the icon of shortcut.
            After that, you will see a new icon on your home screen.
            And you would even been able to execute it by only say its name via Siri

            1 Reply Last reply Reply Quote 1
            • mikael
              mikael @cvp last edited by

              @cvp, issue is the same with the App Store version. Thanks for pointing out the workround.

              1 Reply Last reply Reply Quote 0
              • shinya.ta
                shinya.ta last edited by

                The problem was solved. I was confused because the system has changed quite a lot due to changes in the system.

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

                  @cvp I thought your solution was good but when the shortcut is run it cannot find the script. I've tried putting the script in various of the Pythonista folders, iCloud, site packages etc.

                  I presume I need to give the shortcut the full path to the script, and I've tried a few variants but simply cannot get the right path to make the shortcut fire the script.

                  Ideally I would like to have the script "test.py" in the top iCloud folder, and provide the path to this in the shortcut

                  Any clues?

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

                    @generic shortcut "execute Pythonista script" does not work for iCloud folder of Pythonista

                    That works, but non iCloud and without arguments

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

                      Not sure if this helps anyone but also since running this script does not work at the moment. This workaround does work. If you make a 2 action shortcut with:

                      pythonista3://iCloud/shortcutScript.py?action=run
                          |
                      <open url>
                      

                      it should work. You can get get your script URL with this:

                      import _pythonista, os
                      
                      def this_url():
                      	_script = os.path.realpath(__file__)
                      	script_url = _pythonista.make_url(_script)
                      	return script_url
                      
                      cvp 1 Reply Last reply Reply Quote 0
                      • cvp
                        cvp @couplelongnecks last edited by cvp

                        @couplelongnecks Pythonista doc says

                        Run a script from your library:
                        
                        Use pythonista://MyScript.py?action=run for running a script that is in your library. 
                        By default, the script path is relative to Pythonista’s local documents folder. 
                        Add ?root=icloud to make the path relative to Pythonista’s iCloud folder instead.
                        
                        
                        1 Reply Last reply Reply Quote 0
                        • couplelongnecks
                          couplelongnecks last edited by

                          @cvp This works for you?
                          I havent been able to get that working. If its in the docs its probably user error on my part.
                          Excuse the ignorance but whats the difference/benefit to this method?

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

                            @couplelongnecks you're right, it does not work, sorry.
                            But it seems that pythonista3://iCloud/shortcutScript.py?action=run does not work too...

                            But this works

                            pythonista3://shortcutScript.py?action=run&root=icloud
                            
                            couplelongnecks 1 Reply Last reply Reply Quote 1
                            • couplelongnecks
                              couplelongnecks @cvp last edited by

                              @cvp
                              Awesome! That works for me!
                              The link I posted must have been a fluke, yours must be the robust way. So will implement! :)

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

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

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

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