<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Алгоритм с использованием WinGetText в приложении]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8190&amp;type=atom" />
	<updated>2013-03-28T18:38:48Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8190</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70906#p70906" />
			<content type="html"><![CDATA[<p>Вопрос я просто не полностью понимаю<br />Что значит получать в переменную?<br />Хотя это и неважно наверное.</p><p>у меня в том и состоял осн. вопрос:<br />Возможно ли &quot;выдрать&quot; с приложения текст.</p><p>Мб подскажите как сделать следующее:</p><p>Необходимо чтобы при нажатии(и удерживании) Ctrl или Shift цикл приостанавливался, а когда отпускаешь возобновлялся.</p><p>спасибо.</p>]]></content>
			<author>
				<name><![CDATA[tonik_i_am]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29881</uri>
			</author>
			<updated>2013-03-28T18:38:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70906#p70906</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70905#p70905" />
			<content type="html"><![CDATA[<p>Как вы хотите решить свой вопрос если игнорируете наводящие вопросы:</p><div class="quotebox"><blockquote><p>Вы этот текст получаете с помощью WinGetText в переменную или нет?</p></blockquote></div><p>?<br />Приложение ваше полноэкранное, а значит врядли это как-то получится сделать при помощи WinGetText.<br />Может ImageSearch&nbsp; или PixelSearch поможет, но я их никогда не использовал...</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-03-28T18:13:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70905#p70905</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70904#p70904" />
			<content type="html"><![CDATA[<p>Конкретно:<br />Иrpa &quot;Wогld оf taпкs&quot;<br />переодически танк поджигают, и появляется сообщение &quot;TaHk горит&quot;. Естественно, это процесс не желательный и чтобы его потушить нужно исп. огнетушитель, привязанный к клавише.<br />Возникла идея создать скрипт, который будет отслеживать сообщение о пожаре<br />и сразу же нажимать необходимую клавишу.</p><p><img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Не школьник я, честно <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[tonik_i_am]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29881</uri>
			</author>
			<updated>2013-03-28T18:06:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70904#p70904</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70903#p70903" />
			<content type="html"><![CDATA[<p>Вам требуется нечто конкретное, а вы ходите вокруг да около. Вы этот текст получаете с помощью WinGetText в переменную или нет?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-03-28T18:03:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70903#p70903</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70902#p70902" />
			<content type="html"><![CDATA[<p>Если по-простому то:<br />В приложении иногда появляется текст в центре экрана<br />необходимо, чтобы при появлении этого текста выполнилось действие, и программа ждала следующего появления текста, чтобы повторить действие.</p>]]></content>
			<author>
				<name><![CDATA[tonik_i_am]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29881</uri>
			</author>
			<updated>2013-03-28T17:58:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70902#p70902</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70901#p70901" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>а если же целью является кнопка (доп. &quot;Файл&quot; или &quot;Правка&quot;) в меню блокнота, то не пищит</p></blockquote></div><p>Не понятно что требуется. Нужно объяснить более подробно.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-03-28T17:49:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70901#p70901</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70900#p70900" />
			<content type="html"><![CDATA[<p>Всё хорошо, только вот реагирует только на текст, который можно редактировать, <br />а если же целью является кнопка (доп. &quot;Файл&quot; или &quot;Правка&quot;) в меню блокнота, то не пищит <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /><br />Как я полагаю проблема в сравнивании текста, а конкретнее, в этом: &quot;.*123123.*&quot; <br />Если можно, поясните пожалуйста в каких случаях нужно ставть . * %</p><div class="codebox"><pre><code>Run, D:\New
WinWait, D:\New

Loop    
{
    
    IfWinNotExist, D:\New
        ExitApp
    ifWinActive, D:\New
    DetectHiddenText, On 
    WinGetText, Text , D:\New
    If (Text ~= &quot;Список&quot;)
    {    
           SoundBeep 
    }
    Sleep 100  
}</code></pre></div><p><span class="postimg"><img src="http://savepic.org/3138884.jpg" alt="http://savepic.org/3138884.jpg" /></span><br /><span class="postimg"><img src="http://savepic.org/3124548.jpg" alt="http://savepic.org/3124548.jpg" /></span><br />Спасибо за помощь)<br />Я и подумать не мог, что есть ещё отзывчивые люди <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[tonik_i_am]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29881</uri>
			</author>
			<updated>2013-03-28T17:42:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70900#p70900</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70898#p70898" />
			<content type="html"><![CDATA[<p>Хотя проще наверное в цикле:<br /></p><div class="codebox"><pre><code>

Run, Notepad.exe
WinWait, Безымянный — Блокнот

Loop    
{
    IfWinNotExist, Безымянный — Блокнот
        ExitApp
    DetectHiddenText, On 
    WinGetText, Text , Безымянный — Блокнот
    If (Text ~= &quot;.*123123.*&quot;)
    {    
        Send, {ENTER} Текст обнаружен {ENTER} 
        SoundBeep 
    }
    Sleep 100  
}

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-03-28T16:57:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70898#p70898</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70897#p70897" />
			<content type="html"><![CDATA[<p>Простенький пример:<br /></p><div class="codebox"><pre><code>

Run, Notepad.exe
WinWait, Безымянный — Блокнот

GetText:
    DetectHiddenText, On 
    WinGetText, Text , Безымянный — Блокнот
    If (Text ~= &quot;.*123123.*&quot;)
        GoTo, Action
    IfWinNotExist, Безымянный — Блокнот
        ExitApp
    Sleep 100
    GoTo, GetText 

Action:
    Send, {ENTER} Текст обнаружен {ENTER} 
    SoundBeep
    GoTo, GetText 

</code></pre></div><p>Если в поле блокнота будет &quot;123123&quot; то &quot;Beep&quot; <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-03-28T16:27:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70897#p70897</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Алгоритм с использованием WinGetText в приложении]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70896#p70896" />
			<content type="html"><![CDATA[<p>Доброго времени суток<br />Необходимо, чтобы скрипт проверил есть ли конкретный текст в окне, а затем принял соответствующие действия.</p><div class="codebox"><pre><code>  
#NoTrayIcon
#SingleInstance

Run, C:\Documents and Settings\P.A.N\Рабочий стол\TEST.txt  ; вообще целью является .exe приложение, но я хотел бы понять саму суть.

IfWinActive, TEST.txt - Блокнот

DetectHiddenText, OFF ; если я правильно понимаю работу этой команды, то она необходима, т.к. в приложениях не весь текст виден на экране.

[[[тут мне надо объяснить программе, что если в окне(приложения) появляется текст &quot;123123&quot; она должна сделать действия, приведённые снизу]]]

Send, {ENTER} Текст обнаружен {ENTER} 
SoundBeep

[[[необходимо чтобы скрипт постоянно проверял наличие текста, и когда текс появляется принимал соотв. действия, потом продолжал проверять снова. Когда же окно(приложение) закрывается, скрипт должен выключиться]]]

WinWaitClose, TEST.txt - Блокнот
ExitApp
 </code></pre></div><p>Прочитал много статей, команд, но уложить всё накопленное по полочкам сам не могу.<br />Прошу вашей помощи.<br />Если в будущем найду применение этой програмке с радостью поблагодарю откликнущихся не только добрым словом.<br />Заранее спасибо <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[tonik_i_am]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29881</uri>
			</author>
			<updated>2013-03-28T16:05:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70896#p70896</id>
		</entry>
</feed>
