title: Parse iCal events using Mac OS X Automator
body: <p><a href="https://www.dropbox.com/sh/k988z81n50g7k9d/AAC0sxGpXPtKHd_W0lRZrzVta?dl=0" rel="nofollow">Here's the file I've created</a></p>
  
  <p><a href="https://files.mycloud.com/home.php?brand=webfiles&amp;seuuid=df7f6c26863a92415c795970d1cd9f66&amp;name=ICAL_script__copy.workflow" rel="nofollow">The same file uploaded to different filestorage</a></p>
  
  <p>What I'm trying to do is get companies names and dates from iCal event summaries and put them into Excel file or local variable. Summaries have the following pattern:</p>
  
  <pre><code>$_Compamy name 11.11.2011
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>$_ОАО "Газпром" 11.11.2011
  $_Gazprom OJSC 11.11.2011
  </code></pre>
  
  <p>My idea is to filter entries which contain <code>$_</code>, then trim last 10 characters (or extract dates from summaries).
  The problem lies within Event Summary function of the automator, which generates too much odd text like this one:</p>
  
  <pre><code>TOTAL EVENTS: 3
  
  EVENT 1 OF 3
  Summary:    $_Gazprom OJSC 11.11.2011
  Status: none
  Date:   10/6/15 to 10/6/15
  Time:   9:00:00 AM to 10:00:00 AM
  </code></pre>
  
  <p>I need to build names list and dates list separately in order to use them for document filling, but I can't figure out how to grab specific text for all the events in calendar.</p>