<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: отправка сообщений из txt построчно]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14771&amp;type=atom" />
	<updated>2019-05-09T16:16:33Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14771</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: отправка сообщений из txt построчно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134264#p134264" />
			<content type="html"><![CDATA[<p>Вы вытащите горячую клавишу за пределы цикла. Она и останавливает ваш скрипт.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2019-05-09T16:16:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134264#p134264</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: отправка сообщений из txt построчно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134251#p134251" />
			<content type="html"><![CDATA[<p><strong>rossmad3</strong></p><div class="codebox"><pre><code>1::
Loop
{
    FileReadLine, line, D:\text.txt, %A_Index%
     if ErrorLevel
	{
		MsgBox, 4160, , Готово!
        ExitApp
	}
	FileAppend, %line% `n, %A_ScriptFullPath%
    sleep, 100
}


2::Pause
return


Esc::
{
ExitApp
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2019-05-09T13:56:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134251#p134251</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: отправка сообщений из txt построчно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134250#p134250" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong><br />Подредактировал код.&nbsp; Скрипт запускается, но отправляется только первая строка текста. И всё</p><div class="codebox"><pre><code>1::
Loop
{
    FileReadLine, a, D:\text.txt, %A_Index%
     if ErrorLevel
        ExitApp
	Click
    Send %a% {enter}	
    sleep, 3000
2::Pause
}
return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[rossmad3]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33356</uri>
			</author>
			<updated>2019-05-09T13:16:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134250#p134250</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: отправка сообщений из txt построчно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134247#p134247" />
			<content type="html"><![CDATA[<p>Вы почитайте внимательно про команду FileReadLine в справке. Она имеет параметр, который указывает на имя переменной, в которой будет хранится прочитанный текст. Кроме того, в вашем примере скрипт будет бесконечно читать первую строчку (переменная A_Index в помощь). А ещё советую добавить условие if ErrorLevel, ибо цикл не будет останавливаться, если дойдет до конца документа.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2019-05-09T12:19:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134247#p134247</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: отправка сообщений из txt построчно]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=134245#p134245" />
			<content type="html"><![CDATA[<p>Появилась необходимость в скрипте выполняет построчное печатание текста из .txt файла. То есть, каждую строку этого файла по очереди печатает или отправляет через SendInput нажимая ЛКМ после каждой отправки. Выглядить должно примерно так по хронологии<br />Запуск &gt; Щелчок &gt; отправка первой строки блокнота {enter} &gt; Щелчок &gt; отправка второй строки {enter} и так до конца текстового документа.</p><p>Но столкнулся с некоторыми проблемами, не понимаю как обозначить в строке SendInput что необходимо печатать.<br />И с тем, что при запуске выходит ошибка с чтением нужного блокнота:<br /><span class="postimg"><img src="http://rgho.st/7RJq478Pq/image.png" alt="http://rgho.st/7RJq478Pq/image.png" /></span></p><div class="codebox"><pre><code>1::
Loop
{
    FileReadLine, D:\text.txt, 1
    Click
    SendInput {enter}	
    sleep, 3000
}
return
2::Pause</code></pre></div>]]></content>
			<author>
				<name><![CDATA[rossmad3]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33356</uri>
			</author>
			<updated>2019-05-09T12:06:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=134245#p134245</id>
		</entry>
</feed>
