<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Условие: если буфер обмена содержит заданное слово]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12131&amp;type=atom" />
	<updated>2016-11-07T10:55:02Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12131</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Условие: если буфер обмена содержит заданное слово]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=108986#p108986" />
			<content type="html"><![CDATA[<p>Привет.<br />Можно отправлять строку в функцию, чтобы она возвращала true/false:<br /></p><div class="codebox"><pre><code>
variable := &quot;&quot;
1::
clipboard =
Send ^{vk43}
ClipWait
if (CheckString(Clipboard, &quot;one&quot;)) { ; если буфер содержит слово &quot;one&quot;
	variable := 1
}
; иначе место переменной оставить пустым
run, %comspec% /k %variable% %clipboard%
return

; &gt;&lt;&gt;&lt; FUNC &gt;&lt;&gt;&lt;
CheckString(mainStr, srchStr) {
	if mainStr contains %srchStr%
		return true
	return false
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-11-07T10:55:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=108986#p108986</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Условие: если буфер обмена содержит заданное слово]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=108981#p108981" />
			<content type="html"><![CDATA[<p>Сценарий вызывает команду из выделенного текста. Помогите, пожалуйста, добавить условие:<br /></p><div class="codebox"><pre><code>1::
clipboard =
Send ^{vk43}
ClipWait
; если буфер содержит слово &quot;one&quot;
{
	variable = 1
}
; иначе место переменной оставить пустым
run, %comspec% /k %variable% %clipboard%
return</code></pre></div><p>upd.: Вроде получилось реализовать посредством команды <strong><em>IfInString</em></strong></p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2016-11-07T02:17:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=108981#p108981</id>
		</entry>
</feed>
