title: AutoHotKey Com Object get select list
body: <p>I'm using the following code to just select a drop down menu on a webpage, which I would think would be pretty simple.  Unfortunately, I get an "Unknown Name" error whenever I try to change the selectedIndex of the select list.</p>
  
  <p>This results in an empty message:</p>
  
  <pre><code>test := ie.document.getElementByID("mySelect").selectedIndex.Value
  MsgBox %test%
  </code></pre>
  
  <p>Here is the the HTML:</p>
  
  <pre><code>&lt;SELECT onchange=onchangeSelectOption(); onfocus="hint('Select option');" id=mySelect name=mySelect&gt; 
      &lt;OPTION value=option_1&gt;Option 1&lt;/OPTION&gt;
  &lt;/SELECT&gt;
  </code></pre>
  
  <p>I've tried this to change the selectedIndex and manually trigger the onchange event:</p>
  
  <pre><code>ie.document.getElementByID("mySelect").selectedIndex := 1
  ie.document.getElementByID("mySelect").fireEvent("onChange")
  </code></pre>
  
  <p>I've also tried to get the value in other ways, like:</p>
  
  <pre><code>test := ie.document.all.mySelect.selectedIndex
  MsgBox %test%
  </code></pre>
  
  <p>as well as:</p>
  
  <pre><code>ie.document.all.mySelect.Click()
  </code></pre>
  
  <p>One thing that may be significant.  You can't right-click the select list and view source, but you can do it nearby and find the select list in the DOM.  Also, I believe the options for the select list are loaded dynamically via javascript, so I thought maybe the select wasn't available when I was trying to access it.  I incorporated a long wait time to ensure that everything was loaded, but it still doesn't recognize the name or ID of the select list.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT:  The HTML is inside a frame.  </p>