portrait of John Zanussi wearing sunglasses with his daughter on his shoulders John Zanussi
  • Posts
  • Projects
  • About
  • YouTube
iPhone 15 Pro Action Button Shortcut for Commuting

iPhone 15 Pro Action Button Shortcut for Commuting

🗓️ October 28, 2023 • ⏱️ 3 min read

Intro

I recently got the new iPhone 15 Pro. I’ve been looking for interesting ways to use the new action button on the side of the phone. Up until today, I had it set to open the camera. It’s useful but feels like wasted potential.

I also recently started commuting to/from work again on a somewhat regular but not predictable basis.

I spend most of my commute sitting on the trains of the Long Island Railroad. In recent years, the LIRR has adopted digital tickets via the MTA TrainTime app. This is a vast improvement over dealing with and waiting in line at physical ticket machines at train stations. The big difference I’ve noticed between physical and digital tickets is that a physical ticket can be kept visible while riding when the conductors come around to check. With the digital ticket, since I usually use my phone during the commute, I fumble and swipe through my open apps to find TrainTime before the conductor gets to me.

Screenshot of a LIRR digital ticketA physical paper LIRR ticket

A digital and a physical LIRR ticket

While sitting on the train, thinking of the best ways to utilize the new action button, the conductor came around looking to see my ticket, and I had a lightbulb moment.

Would I be able to open the TrainTime app with the action button only while I’m commuting?

After some thinking and tinkering, I’ve created an iOS Shortcut that does precisely that. Here it is in action.

The key to getting this to work is that I block off time for commuting to/from the office on my work calendar so that no one schedules calls during those times. As seen above, I can use these events as inputs in the shortcut.

Screenshot of Apple Calendar with a "Commuting Home" event from 6-8pm

Shortcut

Below is the full shortcut as captured from my phone. Scroll through to get more information on each step.

Top frame of iPhone 15
Side frame of iPhone 15
Find All Calendar Events where All of the following are true
Search through all the calendar events on my phone where the following conditions are true
Start Date is today and
The start date of a calendar event happens today
Calendar is jzanussi@justworks.com and
The calendar event exists on my work calendar
Title contains Commuting and
The title of the calendar event contains the word "Commuting"
Start Date is before Current Date and
The start date and time of the calendar event is before right now.
End Date is after Current Date
The end date and time of the calendar event is after right now.
Add Filter
Sort by None
No need to sort as we're only looking for one event
Limit. Get 1 Calendar Event
Enable the limit filter and limit to only 1 calendar event
If Calendar Events has any value
If the result of the above logic contains an event with any value it means we satisfied the conditions
Open TrainTime app
Open the TrainTime app
Otherwise
Otherwise, if no event was found
Open Photo in Camera app
Then open the the Camera app set to the Photo screen
End If
All done
Bottom frame of iPhone 15

You can install and try out the shortcut yourself by clicking below.

Get Shortcut Blue Train Icon
Open TrainTime App While Commuting

With the shortcut created, I can map it to the Action button from within iOS settings.

Screenshot of the Action Button settings screen in iOS
REPLACE THIS WITH UPDATED PHOTO

Limitations

  • This only works if I add commuting blocks to my calendar.
  • If there are delays or my whereabouts don’t reflect the calendar, there could be false positives on both sides of the blocks.

Improvements

  • There’s probably some location-based logic I can add to remove some edge cases, like excluding my home and office locations from the true condition.
  • If the LIRR ever adds WiFi to their trains, I could check if my phone is connected to the train’s SSID to trigger the shortcut and cut out the calendar dependency.

This has been working well for now, and I’m excited to continue to find interesting ways to use the iPhone 15 Pro’s action button.

If you’ve got an interesting use case for the action button, please share it in the comments below.

Found the above useful? Have a question? Thought of something I didn't?

Consider leaving a comment below or send me an email at johnzanussi@gmail.com.

You can also buy me a coffee. Cheers!

Buy Me A Coffee

  • Previous Post
    DIY Automated Christmas Tree Watering
  • Next Post
    Migrating from Next.js to Astro

Comments

In this post

  • Intro
  • Shortcut
  • Limitations
  • Improvements
  • Comments
  • Posts
  • Projects
  • About
  • YouTube
  • GitHub
  • LinkedIn
  • Printables
  • Reddit
  • Strava
  • Instagram

Built with Astro, Tailwind, and more.

Subscribe to my RSS feed.

  • Buy me a coffee
  • Email me

All content copyright John Zanussi.