<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: COM IE открыть ссылку в новой вкладке]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14732&amp;type=atom" />
	<updated>2019-04-23T22:51:04Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14732</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: COM IE открыть ссылку в новой вкладке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=133783#p133783" />
			<content type="html"><![CDATA[<p>А я чего-то все через Imacros автоматизирую IE, там js скрипты проще запускать на страницах, да и с вкладками проще все.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2019-04-23T22:51:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=133783#p133783</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: COM IE открыть ссылку в новой вкладке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=133771#p133771" />
			<content type="html"><![CDATA[<p><strong>inseption86</strong><br />Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[g0ss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29338</uri>
			</author>
			<updated>2019-04-23T10:03:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=133771#p133771</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: COM IE открыть ссылку в новой вкладке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=133770#p133770" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
#SingleInstance force 

ie := ComObjCreate(&quot;InternetExplorer.Application&quot;)
ie.Visible := true
ie.Navigate(&quot;https://yandex.ru&quot;)

While	ie.readyState != 4 || ie.document.readyState != &quot;complete&quot; || ie.busy
	Sleep 500

ie := WBFromUrl(&quot;https://yandex.ru/&quot;)

link := ie.document.getElementById(&quot;wd-_weather&quot;).getElementsByTagName(&quot;a&quot;)[0].getAttribute(&quot;href&quot;)


ie.Navigate(link ,2048)
While	ie.readyState != 4 || ie.document.readyState != &quot;complete&quot; || ie.busy
	Sleep 500


ie2 := WBFromUrl(link)

MsgBox % ie2.document.getElementsByTagName(&quot;H1&quot;)[0].innerText &quot;___&quot;  link

  
Process, close, iexplore.exe
ExitApp
 
 
 
 
 WBFromUrl(url)  {
   shell := ComObjCreate(&quot;Shell.Application&quot;)
   loop  {
      for window in shell.Windows  {
         if (window.LocationUrl = url)
            break 2
      }
      Sleep 10
   }
   Return window
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2019-04-23T09:01:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=133770#p133770</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: COM IE открыть ссылку в новой вкладке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=133768#p133768" />
			<content type="html"><![CDATA[<p>Здравствуйте. Подскажите, как сделать, что бы ссылка открывалась в новой вкладке как новый объект, т.е. мне нужно, что бы скрипт мог выполнять действия на новой вкладке. Сейчас есть такой скрипт (открывает в новом окне):</p><div class="codebox"><pre><code>
pwb := ComObjCreate(&quot;InternetExplorer.Application&quot;)
pwb.Visible := True

pwb.Navigate(navSite)
While	pwb.readyState != 4 || pwb.document.readyState != &quot;complete&quot; || pwb.busy
	Sleep 1000

loop,
{
navLink := pwb.document.getElementsByTagName(&quot;a&quot;)[CycleV].href

newtab := ComObjCreate(&quot;InternetExplorer.Application&quot;)
newtab.Visible := true
newtab.Navigate(navLink)
}</code></pre></div><p><a href="https://autohotkey.com/board/topic/94336-solved-ahk-l-open-multiple-tabs-in-ie/">Нашел функцию</a>, которая открывает ссылку в новой вкладке, но при попытке назначить любые действия newtab появляется ошибка: 0x800706BA Сервер rpc недоступен, либо неизвестную ошибку.</p><div class="codebox"><pre><code>pwb.Navigate(navLink, 4096)
		while !newtab
			newtab := New_IE(ProjectLink)

New_IE(Url) {
	For pwb in ComObjCreate(&quot;Shell.Application&quot;).Windows
	{
		If instr( pwb.LocationUrl, URL) &amp;&amp; InStr( pwb.FullName, &quot;iexplore.exe&quot; )
			return pwb
		else
			continue
	}
}</code></pre></div><p>Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[g0ss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29338</uri>
			</author>
			<updated>2019-04-23T06:03:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=133768#p133768</id>
		</entry>
</feed>
