Sample Header Ad - 728x90

How to optimize the time taken to iterate over 200 Reminders using AppleScript/osascript?

1 vote
1 answer
571 views
The script below works as expected, but takes 18 seconds to iterate over 180 Reminders when run from the command line using osascript. Worse, this same script takes only 2-3 seconds when run from within the ScriptEditor and I’d like that level of performance when the script runs itself. # Find all Reminders whose name contains "Alumni" set findMe to "Alumni" set answer to "Maches: " tell application "Reminders" set names to name of every reminder end tell repeat with name in names if name contains findMe then set answer to answer & " --- " & name end if end repeat return answer I've run this script two ways from the command line: As a compiled script: osascript testReminders2.scrpt and as a text file: ./testReminders2.applescript (where this file begins with #! /usr/bin/osascript. Both versions take about the same amount of time. Os there a more efficient way to iterate over Reminders using AppleScript?
Asked by Zack (163 rep)
Mar 31, 2021, 12:23 PM
Last activity: Jun 10, 2025, 03:03 PM