title: Applescript Profiling/Efficiency: Exporting a list of objects and object detail from application
body: <p>I am trying to export reminders data from the Reminders application. The script below will do so, but it takes a very long time (first iteration took 100 minutes, the second iteration is still running).</p>
  
  <p>I have read that sending AppleEvents (in this case around 1000 of them) is what kills performance, but fixes are sparse (I have read about encapsulating the script inside <code>script</code>, <code>end script</code>, and <code>run script</code> but that did not seem to do anything).</p>
  
  <p>A promising but tedious avenue I have not tried is to grab all ten columns separately and unix <code>paste</code> them together.</p>
  
  <p>The real issue is of course looking up every cell of my table one-by-one. How can I just grab all objects (reminders) in <code>rs</code> with all of their detail, by value, and not just a list of references? Then I can parse it how I please.</p>
  
  <pre><code>#!/usr/bin/osascript
  
  set output to "Title,Notes,Completed,Completion Date,List,Creation Date,Due Date,Modification Date,Remind Me Date,Priority\n"
  
  tell application "Reminders"
      set rs to reminders in application "Reminders"
      repeat with r in rs
          set output to output &amp; "\"" &amp; name of r &amp; "\",\"" &amp; body of r &amp; "\",\"" &amp; completed of r &amp; "\",\"" &amp; completion date of r &amp; "\",\"" &amp; name of container of r &amp; "\",\"" &amp; creation date of r &amp; "\",\"" &amp; due date of r &amp; "\",\"" &amp; modification date of r &amp; "\",\"" &amp; remind me date of r &amp; "\",\"" &amp; priority of r &amp; "\"\n"
      end repeat
  end tell
  return output
  </code></pre>