<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Loop_Folder]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15047&amp;type=atom" />
	<updated>2019-11-04T21:09:33Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15047</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Loop_Folder]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136523#p136523" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>inseption86 пишет:</cite><blockquote><p>Исправил, сделал так!</p></blockquote></div><p>А что изменилось?<br /></p><div class="codebox"><pre><code>RVG%A_Index% := % A_LoopFileFullPath</code></pre></div><p>Зачем := % ? Зачем RVG%A_Index% ? Есть же массивы. Чтобы узнать путь к папке, его и сохраняйте целиком.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-11-04T21:09:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136523#p136523</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Loop_Folder]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136521#p136521" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Исправил, сделал так!</p><div class="codebox"><pre><code>
#SingleInstance force

Folder := &quot;C:\Users\smirnovaa\Desktop\1&quot;
Folder2 := &quot;C:\Users\smirnovaa\Desktop\1\~ГРД&quot;

Loop, %Folder%\*, 2, 1
{
	if A_LoopFileAttrib not contains H
		if !Instr(A_LoopFileName, &quot;~ГРД&quot;) 
			RVG%A_Index% := % A_LoopFileFullPath
	  counter++
}


Gui, +ToolWindow  +AlwaysOnTop 
Gui, Font, s15 italic

loop % counter {
	if   % RVG%A_Index% &gt; 0 {
Gui, Add, Button, vButton%A_index% gGetName, % RegExReplace(RVG%A_Index%, &quot;.+\\(.+)\.*.{0}&quot;, &quot;$1&quot;) 
}
}
Gui, Show, , ***
return


GetName:
Gui, Submit, NoHide

loop % counter {
	GuiControl,, Button%A_index%, % RVG%A_Index%
}
GuiControlGet, var,, % A_GuiControl

if Instr(var, &quot;~ГРД&quot;) 
{
Folder := Folder2
}

gui,destroy

var := RegExReplace(var, &quot;.+\\(.+)\.*.{0}&quot;, &quot;$1&quot;)

return

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2019-11-04T12:04:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136521#p136521</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Loop_Folder]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136519#p136519" />
			<content type="html"><![CDATA[<p>:= % Что за странный синтаксис?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-11-04T08:05:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136519#p136519</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Loop_Folder]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136510#p136510" />
			<content type="html"><![CDATA[<p>Добрый день! Подскажите пож-та, имеется каталог &quot;Folder&quot; в нём находятся папки ( Смирнов А, Петров С, Сидоров У....), также в каталоге имеется папка &quot;~ГРД&quot;, в ней также лежат папки ( Иванов Ш, Куличков А ). Название конечных папок я вывел в GUI, возможно ли как-нибудь зачекать в конце, если, конечная папка находилась в каталоге &quot;Folder2&quot;. Заранее спасибо!</p><div class="codebox"><pre><code>
#SingleInstance force

Folder := &quot;C:\Users\smirnovaa\Desktop\1&quot;
Folder2 := &quot;C:\Users\smirnovaa\Desktop\1\~ГРД&quot;

Loop, %Folder%\*, 2, 1
{
	if A_LoopFileAttrib not contains H
		if !Instr(A_LoopFileName, &quot;~ГРД&quot;) 
			RVG%A_Index% := % RegExReplace(A_LoopFileFullPath, &quot;.+\\(.+)\.*.{0}&quot;, &quot;$1&quot;)
	  counter++
}


Gui, +ToolWindow  +AlwaysOnTop 
Gui, Font, s15 italic

loop % counter {
	if   % RVG%A_Index% &gt; 0 {
Gui, Add, Button, vButton%A_index% gGetName, % RVG%A_Index%
}
}
Gui, Show, , ***
return

GetName:
GuiControlGet, var,, % A_GuiControl
gui,destroy

MsgBox % var
return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[inseption86]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38818</uri>
			</author>
			<updated>2019-11-03T10:21:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136510#p136510</id>
		</entry>
</feed>
