Using iPhone Shortcuts to build a better timer

Creating a timer app inspired by the Apple Watch

analog timer with 14 minutes remaining My wife and I set lots of timers. Timers for cooking, timers for the laundry, timers for pour over coffee, timers to remind us that our daughter has been watching tv too long and needs to go to bed, and many more. While it’s not exactly difficult to set a timer on my iPhone, I wanted a shortcut to speed up the process.

On the Apple Watch, there is a timer complication that makes starting a timer extremely quick. I use it all the time. Recently, I was using my old Pebble Time smartwatch instead of my Apple Watch, so I relied on my iPhone’s timer app instead. While the iPhone timer is functional, I missed the quick timers I could pick from on the Apple Watch. Apple Watch Timer

An iPhone timer with options

I wasn’t super familiar with the Shortcuts app, but I knew it could be used to create a menu of options. After a little trial and error, it appeared to be able to set a timer as well.

Putting those two things together, I created a shortcut that presented a menu of times and started a timer for that value. A simple timer shortcut

A shortened menu so it would fit in one screenshot

Repeating the last custom option

One of the best parts of the Apple Watch timer was the custom timer option. Not surprisingly, it allows you to set a timer for however long you’d like. Additionally, there is a history of the last few custom timers you set. I attempted to do something similar on the iPhone using Shortcuts.

The next step was to add a custom option. I simply added a “Custom” option and a prompt to ask for the number of minutes. The entered value is passed as a number to the Timer app. The hard part now was how to save that value.

Shortcuts can pass a variable to another shortcut, but it didn’t seem to be able to pass that value back to itself on the next run. Shortcuts can save files, so I decided to create a text file, quick-timer-last.txt, with the most recent custom value.

I added a “Most Recent Custom (X minutes)” menu item along with some logic to get the value from the file to replace X. Timer menu with custom and most recent custom option

A few more nice to haves

One of the nice things about the iPhone timer is that it displays the time the timer will end (e.g. if I set a 10 minute timer at 4:15, it’ll display 4:25). I stole that idea and added a notification once the timer was set with the end time. Notification with timer end time

The other small improvement was for new users. New user won’t have the quick-timer-last.txt file to populate the “Most Recent Custom” option. I added a little logic to instead say “No recent custom timer” if the file isn’t found.

Where to get it

If you’d like to download my shortcut, you can find it on Routine Hub as Quick Timer Plus. Unfortunately, the “Quick Timer” name was already taken on Routine Hub. Get Quick Timer Plus

See also