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.


    Timed automation in IOS 14

    Pythonista
    6
    17
    6521
    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.
    • ihf
      ihf last edited by ihf

      IOS 14 permits timed automations (Shortcuts which run at a prescribed time) without user intervention for some actions. I tried to run a Pythonista action as part of a timed automation and got the rather strange message which said: "Automation failed. Shortcuts could not open Pythonista. It may not be installed on this device" However if I run the action manually, it works fine. Has anyone tried creating a timed automation and seen the same result?

      mikael 1 Reply Last reply Reply Quote 0
      • mikael
        mikael @ihf last edited by

        @ihf, I experimented with this and launching both via URL and the Pythonista action. When invoked manually, all fine. Timed actions did not seem to anything, except ask to launch if I had that setting on.

        I saw no error messages.

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

          Oh well, I was hoping I could invoke a Pythonista script on a schedule without intervention but that does not seem possible.

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

            I have tried the timed automation shortcut using Pythonista (TASUP) with mixed results.

            I wrote the simplest possible script. Once it worked and several other times it didn’t work. Same script, different results — I have no insight as to why — I suspect it’s a timeout issue with the script and the response.

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

              Edit attempt on September 20 2020 -- added link -- added bold font initials

              Link to my PDF showing my Timed Automation Shortcut Using Pythonista (TASUP).

              PDF link

              Page 4 in the PDF shows the failure notice.

              As Mikael states, the manual use of my shortcut did work; the problem is with timed automation.

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

                I have not checked the docs, but it would make sense that iOS would limit automations to a certain time between launch and response -- apple is always worried about battery life, it does not want you to be able to run long tasks in the background. Pythonista scripts take a long time to launch and run, so maybe it is timing out.

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

                  @JonB, I tried this with already-loaded Pythonista and an already-run script that just dropped a line to a file. When run manually, it was immediate to a human, so probaby not a timeout issue.

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

                    For me (or I'm really bad), automation without asking to tap on the notification does only work if I'm logged on my iPad, not if it is black. At least tested with "sending an email"

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

                      @cvp, I guess we did not even get that far yet, i.e. timed automations that would work in the background when the device is locked. All my experiments were with an unlocked/in-use phone.

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

                        @struct_engineer, I do not see a link. And sorry, what is ”TASUP”?

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

                          @mikael said:

                          timed automations that would work in the background when the device is locked.

                          I used successfully Pyto background module to send a remote notification to my iPhone while my iPad was locked but this stops to work after I did install iOS 14.

                          Thus I hoped I could replace that by Shortcuts automation. 😥

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

                            I've created a shortcut automation for

                            • at a defined time
                            • action = "run shortcut" which only contains an "open url Pythonista3:://script?action=run"
                              without asking before run

                            and it works (in unlocked mode)

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

                              @cvp, what does your Pythonista script do?

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

                                @mikael, see updated post.

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

                                  @mikael nothing special, why? Any script is ok, it is not really started by an automation but by the shortcut

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

                                    Just a guess but is it possible that Apple only permits some of its own actions to run as part of a timed automation with no user interaction from a locked state (and Pythonista is not one of those). Some of Apple's actions (e.g. Execute SSH) work fine but most others do not. I have tried with Scriptable, Pyto, and JSBox actions with no success.

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

                                      @ihf possible and probable, but if action = Apple Shortcut and if this shortcut starts a Pythonista script, your objective is reached, isn't it?

                                      Edit: sorry, I didn't read correctly the from a locked state

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