Home iOS Shortcut Automation Scenarios - Automatically Forwarding Text Messages and Creating Reminder Tasks
Post
Cancel

iOS Shortcut Automation Scenarios - Automatically Forwarding Text Messages and Creating Reminder Tasks

iOS Shortcut Automation Scenarios - Automatically Forwarding Text Messages and Creating Reminder Tasks

iOS uses Shortcuts to easily automate forwarding specific text messages to Line and automatically create reminders for parcel collection and credit card payment

Photo by [Jakub Żerdzicki](https://unsplash.com/@jakubzerdzicki?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash){:target="_blank"}

Photo by Jakub Żerdzicki

Background

Shortcuts (formerly Workflow) is a new feature introduced in iOS 12; it allows users to create a series of tasks to be executed with a single tap and set to run automatically in the background.

In addition to the built-in Shortcuts feature in iOS, Apple has also opened up Siri Shortcuts / App Intents to developers in recent years, allowing third-party apps to integrate some functions into Shortcuts for users to combine.

The automatic execution conditions are currently limited to iOS itself or Apple’s own apps, such as specific times, arrival, departure from a location, NFC detection, receiving messages, emails, or connecting to Wi-Fi, battery level, Do Not Disturb mode, sound detection, and more.

For Apple’s own services, there is no need to jailbreak as in the early days of forwarding text messages; Shortcuts function without jailbreaking and without installing strange third-party apps.

There is already a lot of content online introducing how to use Shortcuts and providing ready-made scripts, so this article will not go into detail.

The message forwarding feature across iOS devices (Settings -> Messages -> Message Forwarding) requires devices with the same Apple ID, so we need to use Shortcuts to help us forward specific messages.

This article only introduces three practical, convenient, and simple application scenarios.

Scenario 1 - Automatically Forward Text Messages

In this era of rampant scam text messages, we are afraid that elderly family members or children at home may receive scam messages and inadvertently provide information to scammers, or that elderly family members may not understand the process of receiving text message verifications for account security and need remote assistance to complete the verification; we also fear that children may use their phones to do things that are not allowed.

Link

https://branch.taipower.com.tw/d112/xmdoc/cont?xsmsid=0M242581319225466606&sid=0N209616847897374705

Effect

Conditions are set as follows:

  • When receiving a text message containing “http,” forward the message “content” to me on Line.
  • When receiving a text message containing “notification,” forward the message “content” to me on Line.
  • When receiving a text message containing “verification code,” forward the message “content” to me on Line.
  • When receiving a text message containing “authentication code,” forward the message “content” to me on Line.

Even in standby mode without unlocking the phone, the forwarding can be executed correctly.

Setup

1. Install & Open the Shortcuts App

2. Switch to the “Automation” tab, select the “+” in the upper right corner, and scroll down to find “Messages”

3. Set Message Conditions

  • “Message contains”: http ( =All text messages with URLs will be forwarded ) Create separate shortcuts for multiple keywords.
  • Change “Confirm then run” to “Run immediately”
  • Click “Next”

When - Other Settings:

  • “Sender”: Multiple, but must be added to contacts
  • At least one of the conditions “Message contains” or “Sender” must be set, so it is not possible to handle all messages without conditions

4. Add Automation Action

  • Select “Add Blank Automation”
  • If you want to forward the message to Line, type “line” in the search box to find Line’s “Send Message” shortcut and select the desired target

If only the last four conversation partners or groups appear here, and if the desired target does not appear, you can go back to Line and send a few messages to the target, then come back and it will appear.

Selecting contacts’ phone numbers in Line to send messages is not effective.

  • Similarly, you can also use the actions “Send Message” or “Send Email” (as shown in the third image) to forward the received message content to text messages (may incur text message charges if iCloud Messages is not enabled) or email.

After adding the recipient

  • Click on “Send ‘Message’ to ‘XXX’,” enter the message in the “Message” input box
  • Swipe right and click on “Shortcut Input”
  • Go back to the top and click on “Send ‘Shortcut Input’ to ‘XXX’,” enter the shortcut in the “Shortcut Input” input box
  • In the pop-up menu, change the originally selected “Message” to “Content”
  • Click the “X” next to the menu to close
  • Click “Done” in the upper right corner

To change the recipient to XXX, you need to click on the right X to remove the entire Line action, then add the Line Send Message action again with the new recipient.

  • Confirm the final setting result is: When I receive a message containing "XXX", treat the message as input, Line will send "content" to "XXX"
  • No problem, click “Done” in the upper right corner. If there is no response after clicking Done, it may be due to an iOS Bug. You can ignore it and directly click Back to return to the homepage.
  • Back to the Shortcuts Automation homepage to view, pause, or modify this shortcut.

Done!

Just wait for new text messages to come in, and if they contain the specified keywords, they will be automatically forwarded (even if the phone is not unlocked). Due to current functionality limitations, a separate shortcut needs to be created for each keyword, and if the same text message contains different keywords, it will be sent twice.

Scenario 2 — Automatically Create Reminder Tasks When Packages Arrive at Convenience Stores

I currently use Apple’s built-in Reminders as a tool for managing daily tasks, so I also want to integrate things that need to remind me, such as package arrival at convenience stores, credit card payment notifications, etc.

Effect

Setting conditions as follows:

  • When a text message containing “已在” is received, add a reminder task (Coupang uses “已在”).
  • When a text message containing “送達” is received, add a reminder task (usually “送達”).

Setup Steps

1. Install & Open Shortcuts App

2. Switch to the “Automation” tab, select the “+” in the upper right corner, and scroll down to find “Messages”

3. Set Message Conditions

Similar to the conditions set for automatically forwarding text messages in the previous section, here set Message content contains "送達" and change to "Run Immediately".

4. Add Automation Actions & Set Reminder Time

First, we need to set the due date for the reminder task, add a date variable, calculate the time starting from when the message is received + the desired reminder time.

  • Select Add a new blank automation action
  • In the search box below, search for Adjust Date
  • Select Adjust Date
  • In the input box for Date to add 0 seconds to, select Current Date
  • Select Add 0 "seconds", change to days in the input box for seconds
  • Enter the number of days you want for the reminder time, here I enter 3 days
  • Click the “X” next to the menu to close

5. Add Reminder Task Action

  • In the search box, enter Reminder, scroll down and click on Add Reminder

After adding “Add Reminder”,

  • Click on the first Reminder input box under Add "Reminder" to "Reminders" without prompting
  • Swipe right and click on Shortcut Input
  • Click on Add "Shortcut Input" to "Reminders" without prompting in the Shortcut Input input box
  • In the pop-up menu, change the originally selected Message to Content
  • Click the “X” next to the menu to close

6. Set Reminder Notifications

  • Change from "Do not remind" to "Remind"
  • Select "2:00 PM" in the input box next to "2:00 PM", choose the variable "Adjusted Date"
  • Click the “X” next to the menu to close
  • After everything is okay, click “Done” in the top right corner If clicking “Done” does not respond, it may be an iOS bug. You can ignore it and directly click “Back” to return to the home page.

  • Back to the Shortcuts Automation homepage to view, pause, or modify this shortcut.

Done!

As mentioned earlier, just wait for a new text message to come in. If it contains the specified keywords, a reminder will be automatically created (even if the phone is not unlocked). Due to current limitations, a separate shortcut needs to be created for each keyword. If the same text message contains different keywords, two reminders will be created.

Scenario 3 - Automatically Create Reminder Tasks When Receiving Credit Card Bill Emails

Another useful notification is for credit card bill notifications. Similar to text messages, you can trigger a shortcut automation to add a reminder task when receiving an email. However, since automation functions are not yet available to third-party apps, you can only use the Apple Mail App to trigger it.

Effect

Setting conditions as follows:

  • When the email subject contains “Credit Card Bill,” add a reminder task

Please note that each company has a different format. Some may call it “Credit Card E-Bill,” “Credit Card E-Statement,” and even more specific like “Credit Card XXXX Year X Month E-Bill” for Cathay Pacific.

Since Regex is not supported at the moment, text matching is the only option. As mentioned earlier, a separate shortcut needs to be created for each keyword.

1. Ensure you have installed the Mail App and completed the mailbox account login (Gmail is also supported)

2. Confirm Email Fetch Settings

Confirm “Settings” -> “Mail” -> “Accounts” -> “Fetch New Data” is set to fetch or push.

3. Install & Open the Shortcuts App

4. Switch to the “Automation” tab, select the “+” in the top right corner, scroll down to find “Email”

5. Set Email Conditions

  • “Subject Contains”: Credit Card Bill Create multiple shortcuts for multiple keywords.
  • Change “Ask Before Running” to Run Immediately
  • Click “Next”

Additional Settings:

  • “From”: Multiple, but must be added to contacts
  • Other Filter Conditions - Account: Can filter sources like iCloud or Gmail
  • Other Filter Conditions - Recipient: Multiple, but must be added to contacts, usually multiple accounts of oneself

4. Add Automation Actions & Set Reminder Time

First, set the expiration date of the reminder, add a date variable, calculate the time when the message is received + the time interval to get the desired reminder time.

  • Choose Add a blank automation action
  • In the search box below, search for Adjust date
  • Select Adjust date
  • Choose Add 0 seconds to "date" in the input box for date
  • Below, select the variable, choose Current date
  • Change the seconds in Add 0 "seconds" to days
  • Enter the number of days you want for the reminder expiration, here I enter 3 days
  • Click the “X” next to the menu to close

5. Set Email Filtering

Unlike triggering message by message, email triggering is batch fetching, so as long as the batch contains emails with the keyword title, those new emails will also be brought in together.

Not sure if it’s a shortcut bug, but the result is as described.

For example: Batch fetch three emails, including a Carrefour notification email, a credit card bill email, and an Uber notification email, all three will be input as shortcuts; therefore, we need to add another step to filter out the keyword emails we want.

Pseudo Logic:

1
2
3
4
5
6
for email title in emails
  if email title.contains("credit card bill") then
    Add reminder
  else
  end 
end

  • In the search box, type Repeat, scroll down and click on Repeat every item
  • After adding, it will grab the wrong variable, select Every item in "adjusted date" in the input box for adjusted date, choose Clear variable
  • After clearing, select Every item in "item" in the input box for item, choose Shortcut input

  • In the search box, type If, scroll down and click on If
  • At this point, the position will be wrong

  • Drag the If "Repeat Result" "Condition" action under Every item in Shortcut Input
  • Confirm the final position as shown in the second image above, if incorrect, delete Repeat and If and redo from the previous step
  • Click on the Repeat Result input box of If "Repeat Result" "Condition", below change to select Title, click the “X” next to the menu to close

  • Click on the Title input box of If "Title" "Condition", change to select Contains, enter credit card bill, click “Done” on the keyboard

6. Set Email Filtering

  • Search for “Reminder” in the search box and scroll down to find and click on “Add Reminder”.
  • At this point, the location will be incorrect.
  • Drag the action of “Add ‘Reminder’ to ‘Reminder’ and ‘Do Not Notify’” to below “Title”, “Contains”, “Credit Card Bill”.
  • Confirm the final position as shown in the third image above. If it is incorrect, delete the duplicates and repeat from the previous step.

After adding “Add Reminder”:

  • Click on the first “Reminder” input box in “Add ‘Reminder’ to ‘Reminder’ and ‘Do Not Notify’”.
  • Swipe right to find and click on “Recurring Item”.
  • Go back to the top and click on the input box for “Recurring Item”, change the originally selected “Email” to “Title”.
  • Click on the “X” next to the menu to close.

6. Set Reminder Alert

Change “Do Not Notify” to “Notify”. Select “2:00 PM” in the “2:00 PM” input box, choose the variable “Adjusted Date”. Click on the “X” next to the menu to close. If there is no response after clicking “Done”, it may be an iOS bug. You can ignore it and click “Back” to return to the home screen.

You can view, pause, or modify this shortcut on the Shortcuts Automation homepage.

Done!

Setting up email is a bit more complicated because it involves batch extraction, so you need to filter again and create reminders based on the filtered results.

  • Now, if there are new emails and Apple Mail has finished extracting, and there is a title of a credit card bill, it will be automatically created!
  • Since Apple Mail is extracted (if not iCloud), email retrieval is not instant and will be delayed for a while.

Others

After the Shortcuts Automation is executed, a notification will pop up that cannot be closed.

End

You have now completed several basic automation integration functions, saving you daily effort with just a few simple steps. For more advanced integrations, such as API integration with Notion or more complex integrations, they can also be achieved technically. What you lack is not the technology but your imaginative automation ideas!

Further Reading on Automation

If you have any questions or feedback, feel free to contact me.



This post is licensed under CC BY 4.0 by the author.

iOS Vision framework x WWDC 24 Discover Swift enhancements in the Vision framework Session

iOS Temporary Workaround for Black Launch Screen Bug After Several Launches