Keep Shortcut waiting until return to Shortcuts

I have a Shortcut that includes a “meditation” step. At that step, it pushes me to the Pause app (though any meditation app would do) and the intention is that after I complete two-ish minutes of meditation, I return to the Shortcut and it does some other things.

Sometimes, however, Shortcuts quits the running Shortcut while I’m meditating. When I return to Shortcuts, I have to restart the entire Shortcut, repeating some steps that take place before the meditation.

I have a “Wait to Return” action after the “Open App” action that funnels me to Pause. Is there anything else I can do to keep Shortcuts in suspense while the app isn’t open?

(If this has already been discussed, point me along? I tried to find previous topics on this but failed.)

That should be fine. Is it definitely only ever two minutes or thereabouts?

1 Like

No, two mins is approximate. The longer the meditation, the more likely the deactivation of the Shortcut, it seems.

Is there a known timeout?

As far as I know, after 9 or 10 minutes, iOS kills any app that doesn’t do any background stuff like playing music, downloading stuff and was designed for that. There is currently no way to do that sort of things while waiting to return. Your best bet at the moment is to split your shortcut into two parts and run the second part manually after returning

1 Like

You can create a shortcut that waits in the background almost indefinitely, but you have to do something periodically to keep it alive. In my Cronios shortcut (a shortcut that lets you run other shortcuts in the background based on date/time), the shortcut plays a quick “beep” sound every minute. I’ve found this to be extremely effective at keeping the shortcut running for hours on end.

For your needs, do you configure the amount of time to meditate in the shortcut or in the pause app? If the former, you’ll want to set an internal timer in your shortcut to repeat for X number of minutes, playing the “beep” sound every minute to keep the shortcut running. At the end of X minutes, you’ll exit out of the repeat loop and call the Wait to Return action.

For the “beep” sound, use the Speak Text action set to the fastest rate and pitch.

Hope this helps.

2 Likes

Cronios is a role model for this kinda thing! Thanks for the trick. I imagine the beep might interfere with any sound currently playing—does iOS muffle other sounds to “let the beep through”?

The trick with this little workflow is that there’s no configured time. It’s basically a pomodoro round with meditation at the front-end. The shortcut asks me what I want to work on and for how long. I then meditate to clear my head, and when I return the shortcut reminds me of the task at hand and how long I’m going to work for (along with doing a few other things, like telling my Mac to trigger Focus for the duration of the work).

I think I can play with the repeat loop to make this work, though.

Yes, iOS will duck any sound playing in order to let the beep go through. I have tried playing an empty string, but iOS still causes a long-running Shortcut to terminate after a few minutes. You can experiment with different text strings to speak to find one that’s the least obtrusive for you.

1 Like