I’ve played with the Shortcuts app a few times and although their power is impressive, I haven’t found a need for any in my day-to-day workflow. This Shortcut may finally change that.
Here’s the problem
Our dog literally can’t handle the heat. She’s a Miniature Schnauzer born with a microtrachea so she struggles to regulate her body temperature. If she gets overheated it’s bad news.
I typically let her out multiple times a day while working from home. All I have to do is open up our back door, let her out into her fenced doggie area, and let her back in when it’s time.
That last item is trickier than it sounds – if I don’t set a timer I risk getting into the zone at work and losing track of the world. That could be disastrous, so up until now I’ve set a timer and altered the duration depending on the temperature outside. I wondered if I could improve that with a Shortcut.
Build a Shortcut to:
- Fetch the outside temperature
- Set (or don’t set) a timer of varying duration depending on how hot it is
- Temp <= 75°F: She can stay out for 25 minutes
- 75°F > Temp <= 85°F: Map this range from 25 minutes to 1 minute
- Temp > 85°F: She shouldn’t go out right now
These undoubtedly will get tweaked in the future.
Here’s the Shortcuts solution:
A programmer’s perspective
Arguably the most powerful line is the first one – magic happens and tada 🪄 the weather is provided for any place you choose. That’s pretty cool!
- Why can’t I set the
Timevariable to a parsed number directly Maybe there’s a better way I haven’t explored.
- As you can see in the screenshot, this Shortcut isn’t supported on macOS because there’s no “Start Timer”. Why not? The shortcut runs fine on iOS / iPadOS.