<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: IE COM, выбор из списка]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14320&amp;type=atom" />
	<updated>2018-12-26T13:05:37Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14320</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130610#p130610" />
			<content type="html"><![CDATA[<p>Добрый день! Всем спасибо за ответы!</p><div class="codebox"><pre><code>ie.document.getElementsByName(&quot;*****&quot;)[0].value := ***
Change := ie.document.createEvent(&quot;Event&quot;)
Change.initEvent(&quot;change&quot;, true, true)
ie.document.getElementsByName(&quot;******&quot;)[0].dispatchEvent(Change)</code></pre></div><p>А возможно ли узнать profileId (в данном случае &quot;2222&quot;), имея&nbsp; data-profile-id (в данном случае &quot;1111&quot;)?</p><div class="codebox"><pre><code>&lt;a target=&quot;_blank&quot; data-bind=&quot;text:LastName() + &#039; &#039; + FirstName()+ &#039; &#039; + SecondName(), attr:{&#039;data-profile-id&#039;:$data.TicketID, &#039;href&#039;: &#039;/**/***/****/****&#039; + &#039;?profileId=&#039; + $data.ProfileID()}&quot; data-profile-id=&quot;1111&quot; href=&quot;/**/**/***/***?profileId=2222&quot;&gt;Смирнов Александр Алексеевич&lt;/a&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-12-26T13:05:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130610#p130610</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130481#p130481" />
			<content type="html"><![CDATA[<p>Читайте эти темы:<br /><a href="http://forum.script-coding.com/viewtopic.php?id=9183">http://forum.script-coding.com/viewtopic.php?id=9183</a><br /><a href="http://forum.script-coding.com/viewtopic.php?id=14379">http://forum.script-coding.com/viewtopic.php?id=14379</a><br />В консоле хрома изучайте какие события отправляете.</p><p>События проще создавать по такому алгоритму:<br />событие mousedown<br /></p><div class="codebox"><pre><code>event := oIE.document.createEvent(&quot;Event&quot;)
event.initEvent(&quot;mousedown&quot;, true, false)
target.dispatchEvent(event)</code></pre></div><p>событие keydown<br /></p><div class="codebox"><pre><code>event := oIE.document.createEvent(&quot;Event&quot;)
event.initEvent(&quot;keydown&quot;, true, false)
event.keyCode := 13 ; enter
target.dispatchEvent(event)</code></pre></div><p>Список событий:<br /><a href="https://developer.mozilla.org/en-US/docs/Web/Events">https://developer.mozilla.org/en-US/docs/Web/Events</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-19T17:06:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130481#p130481</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130479#p130479" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Да всё тот же (см.выше), он локальный на работе</p>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-12-19T16:49:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130479#p130479</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130478#p130478" />
			<content type="html"><![CDATA[<p>Какой сайт и что вы хотите выбрать?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-19T16:14:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130478#p130478</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=130477#p130477" />
			<content type="html"><![CDATA[<p>Добрый&nbsp; вечер!</p><div class="codebox"><pre><code>
MouseDownEvent := IE.document.createEvent(&quot;MouseEvent&quot;)
MouseDownEvent.initMouseEvent(&quot;mousedown&quot;,true,false, _, _, _, _, _, _, _, _, _, _, _, _)

MouseUpEvent := IE.document.createEvent(&quot;MouseEvent&quot;)
MouseUpEvent.initMouseEvent(&quot;mouseup&quot;,true,false, _, _, _, _, _, _, _, _, _, _, _, _)


IE.document.querySelector(&quot;Span[Id=&quot;&quot;dropdown_newprofile911601539&quot;&quot;]&quot;).dispatchEvent(MouseDownEvent)
Send {down}
sleep 200
Send {Tab}{Enter} 
</code></pre></div><p>Работает!, а возможно ли это сделать не через Send? а сразу? что-то типа такого:<br /> </p><div class="codebox"><pre><code>
ie.Document.getelementById(&quot;dropdown_newprofile911601539&quot;).selectedIndex :=1 или ...value := &quot;Example1&quot;
ie.Document.getelementById(&quot;dropdown_newprofile911601539&quot;).onchange
</code></pre></div><div class="codebox"><pre><code>
&lt;select name=&quot;newprofile&quot; id=&quot;dropdown_newprofile911601539&quot; onchange=&quot;submit()&quot; size=&quot;1&quot; tabindex=&quot;-1&quot; title=&quot;&quot; style=&quot;display: none;&quot;&gt;&lt;option value=&quot;8&quot;&gt;Example1&lt;/option&gt;&lt;option value=&quot;13&quot; selected=&quot;&quot;&gt;Exampl2&lt;/option&gt;&lt;/select&gt;

&lt;option value=&quot;8&quot;&gt;Example1&lt;/option&gt;
&lt;option value=&quot;13&quot; selected=&quot;&quot;&gt;Example2&lt;/option&gt;


&lt;script type=&quot;text/javascript&quot;&gt;
//&lt;![CDATA[

$(&#039;#dropdown_newprofile911601539&#039;).select2({
                  width: &#039;150px&#039;,
                  closeOnSelect: false,
                  dropdownAutoWidth: true,
                  quietMillis: 100,
                  minimumResultsForSearch: 10,
                  formatSelection: function(object, container) {
                     text = object.text;
                     if (object.element[0].parentElement.nodeName == &#039;OPTGROUP&#039;) {
                        text = object.element[0].parentElement.getAttribute(&#039;label&#039;) + &#039; - &#039; + text;
                     }
                     return text;
                  },
                  formatResult: function (result, container) {
                     container.attr(&#039;title&#039;, result.title || result.element[0].title);
                     return result.text;
                  }

             });
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-12-19T16:08:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=130477#p130477</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129948#p129948" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>MouseDownEvent := IE.document.createEvent(&quot;MouseEvent&quot;)
MouseDownEvent.initMouseEvent(&quot;mousedown&quot;,true,false, _, _, _, _, _, _, _, _, _, _, _, _)

MouseUpEvent := IE.document.createEvent(&quot;MouseEvent&quot;)
MouseUpEvent.initMouseEvent(&quot;mouseup&quot;,true,false, _, _, _, _, _, _, _, _, _, _, _, _)


IE.document.querySelector(&quot;Span[Id=&quot;&quot;select2-chosen-5&quot;&quot;]&quot;).dispatchEvent(MouseDownEvent)
IE.document.querySelector(&quot;Span[Id=&quot;&quot;select2-chosen-5&quot;&quot;]&quot;).dispatchEvent(MouseUpEvent)

return</code></pre></div><p>)))).Спасибо!!!</p>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-11-21T15:22:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129948#p129948</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129947#p129947" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong></p><div class="codebox"><pre><code>click() или click</code></pre></div><p> так же не работает! Через mouseevent, я так понял, это когда уже список отобразится</p>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-11-21T15:17:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129947#p129947</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129946#p129946" />
			<content type="html"><![CDATA[<p>Зачем вы в методе click указываете параметры?<br />И внимательно читайте 7 сообщение.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-11-21T15:03:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129946#p129946</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129945#p129945" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong></p><br /><div class="codebox"><pre><code>ie.document.querySelector(&quot;Span[Id=&quot;&quot;select2-chosen-5&quot;&quot;]&quot;).click(1)
ie.Document.GetelementById(&quot;select2-chosen-5&quot;).click(1)
ie.document.getElementsByTagName(&quot;Span&quot;)[39].click(1)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-11-21T14:44:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129945#p129945</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129944#p129944" />
			<content type="html"><![CDATA[<p>Приведите код.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-11-21T14:39:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129944#p129944</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129943#p129943" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong></p><p>Пробовал, не кликается!</p>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-11-21T14:34:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129943#p129943</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129941#p129941" />
			<content type="html"><![CDATA[<p>Почему не хотите кликать мышкой?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-11-21T14:24:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129941#p129941</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129939#p129939" />
			<content type="html"><![CDATA[<p>Добрый день! До сих пор не могу разобраться, текст в поле вставляется, а страница дальше не прогружается.</p><div class="codebox"><pre><code>
ie.document.querySelector(&quot;Span[Id=&quot;&quot;select2-chosen-5&quot;&quot;]&quot;).innerHTML := &quot;Ремонт МФУ HP LaserJet Pro 400 MFP - &quot;
ie.document.querySelector(&quot;Span[Id=&quot;&quot;select2-chosen-5&quot;&quot;]&quot;).onchange
</code></pre></div><br /><div class="codebox"><pre><code>
ie.document.querySelector(&quot;Span[Id=&quot;&quot;select2-chosen-5&quot;&quot;]&quot;).innerHTML := &quot;Ремонт МФУ HP LaserJet Pro 400 MFP - &quot;
Change := ie.document.createEvent(&quot;Event&quot;)
Change.initEvent(&quot;change&quot;, true, true)
ie.document.getElementById(&quot;select2-chosen-5&quot;).dispatchEvent(Change)
</code></pre></div><br /><p>Поле ввода:<br /></p><div class="codebox"><pre><code>&lt;a tabindex=&quot;-1&quot; class=&quot;select2-choice&quot; href=&quot;javascript:void(0)&quot;&gt;   &lt;span class=&quot;select2-chosen&quot; id=&quot;select2-chosen-5&quot;&gt;-----&lt;/span&gt;&lt;abbr class=&quot;select2-search-choice-close&quot;&gt;&lt;/abbr&gt;   &lt;span class=&quot;select2-arrow&quot; role=&quot;presentation&quot;&gt;&lt;b role=&quot;presentation&quot;&gt;&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;</code></pre></div><p>OuterHTML:<br /></p><div class="codebox"><pre><code>&lt;div title=&quot;Ремонт МФУ HP LaserJet Pro 400 MFP - &quot; class=&quot;select2-result-label&quot; id=&quot;select2-result-label-256&quot; role=&quot;option&quot;&gt;»&lt;span class=&quot;select2-match&quot;&gt;Ремонт&lt;/span&gt; МФУ HP LaserJet Pro 400 MFP&lt;/div&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2018-11-21T13:07:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129939#p129939</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129789#p129789" />
			<content type="html"><![CDATA[<p>Отлично.<br />Добавил к тому сообщению.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-11-14T19:26:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129789#p129789</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: IE COM, выбор из списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129788#p129788" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>А вот вариант исполнения джаваскрипта напрямую</p></blockquote></div><p>Вот ещё один:<br /></p><div class="codebox"><pre><code>oIE := ComObjCreate(&quot;InternetExplorer.Application&quot;)
oIE.navigate(&quot;http://help.dottoro.com/external/examples/ljwcseaq/onmousedown_4.htm&quot;)
oIE.visible := true

While oIE.readyState != 4 || oIE.document.readyState != &quot;complete&quot; || oIE.busy
   Sleep, 10

oIE.document.parentWindow.execScript(&quot;OnButtonUp()&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-11-14T19:07:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129788#p129788</id>
		</entry>
</feed>
