<?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=6206&amp;type=atom" />
	<updated>2011-09-11T13:14:52Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6206</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: массив]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51412#p51412" />
			<content type="html"><![CDATA[<p>Так как задача предоставлена в виде примера скрипта, позволю себе вольную трактовку <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>Если желаемое действие при нажатии горячей клавиши - переименование папки/файла под курсором в окне проводника&nbsp; windows так, как это представлено в скрипте выше, то можно использовать подобный скрипт:<br /></p><div class="codebox"><pre><code>
F1::
INPUT, SecondKey, T1 ,,1,2,3,4,5,6,7,8,9,0
If (ErrorLevel = &quot;Match&quot;) {
  Send {F2}
  Send ^{Insert}  ; эти строки следует удалить
  ClipWait        ; если желаемое имя файла/папки уже в буфере обмена
  StringLower, TextLow, Clipboard
  SendInput %TextLow%_trn%SecondKey%
  Send {Enter}
}</code></pre></div><p>В течении секунды после нажатия (и отпускания)&nbsp; F1 ожидается ввод цифры, после чего происходит переименование по нужному шаблону.<br />Если есть желание использовать именно alt+цифра то вот еще пример:<br /></p><div class="codebox"><pre><code>
!1::
!2::
!3::
!4::
!5::
!6::
!7::
!8::
!9::
  Send {F2}
  Send ^{Insert}  ; эти строки следует удалить
  ClipWait        ; если желаемое имя файла/папки уже в буфере обмена
  StringLower, TextLow, Clipboard
  SendInput % TextLow . &quot;_trn&quot; . SubStr(A_ThisHotkey, 0, 1)
  Send {Enter}
Return</code></pre></div><p>да простят меня специалисты за подобное извращение <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>Если цель — переименовать некие файлы/папки автоматически — лучше воспользоваться <a href="http://www.script-coding.com/AutoHotkey/LoopFilesFolders.html">Loop (file)</a></p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2011-09-11T13:14:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51412#p51412</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: массив]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51411#p51411" />
			<content type="html"><![CDATA[<p>т.е. эта задача, только короче<br /></p><div class="codebox"><pre><code>!1::
StringLower, TextLow, Clipboard
send {f2}
send %TextLow%_trn1
Return

!2::
StringLower, TextLow, Clipboard
send {f2}
send %TextLow%_trn2
Return

!3::
StringLower, TextLow, Clipboard
send {f2}
send %TextLow%_trn3
Return

!4::
StringLower, TextLow, Clipboard
send {f2}
send %TextLow%_trn1
Return

!5::
StringLower, TextLow, Clipboard
send {f2}
send %TextLow%_trn1
Return

!6::
StringLower, TextLow, Clipboard
send {f2}
send %TextLow%_trn6
Return

!7::
StringLower, TextLow, Clipboard
send {f2}
send %TextLow%_trn7
Return

!8::
StringLower, TextLow, Clipboard
send {f2}
send %TextLow%_trn8
Return

!9::
StringLower, TextLow, Clipboard
send {f2}
send %TextLow%_trn9
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Вадим]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27175</uri>
			</author>
			<updated>2011-09-11T11:52:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51411#p51411</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: массив]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51410#p51410" />
			<content type="html"><![CDATA[<p>а я не знаю как назвать.<br />Задача: после нажатия alt+1, alt+2, alt+3 и так до 9, что переименовывало выделенный файл (т.е. просто команда send {f2}) в файл &quot;trn%x%&quot;<br />x - это число от 1 до 9, какое было нажато раньше.</p>]]></content>
			<author>
				<name><![CDATA[Вадим]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27175</uri>
			</author>
			<updated>2011-09-11T11:49:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51410#p51410</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: массив]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51409#p51409" />
			<content type="html"><![CDATA[<p><span style="color: green"><strong>Вадим</strong>, заголовок темы должен отражать суть задачи, отредактируй.</span> Сама задача тоже неясна. Что переименовывать-то?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-09-11T11:41:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51409#p51409</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: массив]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51408#p51408" />
			<content type="html"><![CDATA[<p>Нужен скрипт, который при нажатии на клавиши от ALT+1 до ALT+9 переименовывает в text_[1..9] <br /></p><div class="codebox"><pre><code>Array := []

Loop 9            
   Array[A_Index] := A_Index
for i in Array
!%array.i%::
send {f2}
send text_%array.i%
return</code></pre></div><p>примерный текст.</p>]]></content>
			<author>
				<name><![CDATA[Вадим]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27175</uri>
			</author>
			<updated>2011-09-11T11:28:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51408#p51408</id>
		</entry>
</feed>
