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?