Using AppleScript to create reminders from text lists
Last night as I was heading out to do some grocery shopping, I thought I’d try using the reminders app to keep track of our shopping list. I wanted to use the reminders app on my watch, so that I didn’t have to keep getting my phone out and unlocking it[1].
However, our shopping list was in a note in the Notes app. I expected to be able to copy and paste the list into the Reminders app, but no – it just created a single reminder with the entire shopping list in it.
This is definitely something that should just work, and it seems like a real oversight that it doesn’t, but at least it gave me something to do on my Saturday afternoon…
I decided to try and use Automator to create a Quick Action to easily turn a text list into Reminders.
If you want to use this Quick Action yourself, follow these steps:
- In the Automator app on your mac, create a new Quick Action workflow.
- In the settings for the quick action at the top of the main pane, set ‘Workflow receives current’ to ‘text’ in ‘any application’.
- Add a new ‘Run AppleScript’ action to the workflow, with the following script:
on run {input, parameters}
tell application "Reminders"
-- bring to foreground
activate
-- ask which list to add to
set allLists to name of every list
set chosenList to (choose from list allLists with prompt "Select the list to add reminders to" without empty selection allowed)
-- if the user presses cancel, abort
if chosenList is false then return
set chosenList to chosenList as string
-- split input to workflow into paragraphs and add to chosen list
repeat with lineOfText in paragraphs of (item 1 of input)
set lineOfText to lineOfText as string
if lineOfText is not equal to "" then
tell list chosenList
make new reminder at end ¬
with properties {name:lineOfText}
end tell
end if
end repeat
end tell
end run - Save the workflow as ‘Copy to Reminders’
With text selected in another application, you should now be able to right-click and select ‘Copy to Reminders’ from the ‘Services’ sub-menu, as shown in the video above.
If you’ve found this useful, please do let me know!
The next version of iOS / watchOS should make unlocking an iPhone whilst wearing a mask easier 🥳 ↩︎