title: Class based selectors for AppleScript list items failing for UI element objects
body: <p>AppleScript’s <em>list</em> data type has only a very limited support for <strong>boolean test specifiers</strong>. Besides picking items by range (with the <em>item</em> keyword), specifying a class will work:</p>
  
  <pre><code>get every «class furl» of {1, "Test", (POSIX file "/posix/path")} --&gt; {file ":hfs:path"} 
  </code></pre>
  
  <p>When the list items are references, dereferencing with the <em>contents</em> keyword will work:</p>
  
  <pre><code>get every «class furl» of {1, "Test", a reference to (POSIX file "/posix/path")} --&gt; {}
  get every «class furl» of contents of {1, "Test", a reference to (POSIX file "/posix/path")} --&gt; {file ":hfs:path"}
  </code></pre>
  
  <p>So why does the following code set <code>allTextAreas</code> to an empty list:</p>
  
  <pre><code>tell application "System Events"
      set allUIElements to entire contents of window 1 of someApplication 
      set allTextAreas to every text area of contents of allUIElements --&gt; {}
  end tell
  </code></pre>
  
  <p>given that <code>allUIElements</code> is a list of references to <em>UI element</em> objects, and that at least one of them is of class <em>text area</em>?</p>
  
  <p><strong>Note I am <em>not</em> looking for suggestions how to retrieve all UI elements of a certain type from the list (a <code>repeat</code> loop will do that) – I would like to understand why the selector pattern fails in this specific case.</strong></p>