How to properly (quickly) iterate over Reminders using AppleScript/osascript? What is the proper, efficient way to iterate over Reminders using AppleScript?  The script below works as expected, but takes 18 seconds to iterate over 180 Reminders when run from the command line using osascript!  (This same script takes only 2-3 seconds when run from within the ScriptEditor.)
# Find all Reminders whose name contains &quot;Alumni&quot;
set findMe to &quot;Alumni&quot;
set answer to &quot;Maches: &quot;

tell application &quot;Reminders&quot;
    set names to name of every reminder
end tell

repeat with name in names
    if name contains findMe then
        set answer to answer &amp; &quot; --- &quot; &amp; 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.
I don't have enough reminders to test for speed but give this a try. You can get the 'named' reminders into a list with one step and then coerce that list into your text output with a second. This should be faster than iterating through them individually.
# Find all Reminders whose name contains &quot;Alumni&quot;
set findMe to &quot;Alumni&quot;
set answer to &quot;Maches: &quot;

tell application &quot;Reminders&quot; to ¬
    set names to name of ¬
        (every reminder whose name contains findMe)

set {TID, AppleScript's text item delimiters} to ¬
    {AppleScript's text item delimiters, &quot; --- &quot;}
set answer to answer &amp; names as text
set AppleScript's text item delimiters to TID

return answer