<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Расстановка навигации в HTML-файлах]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10463</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10463&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Расстановка навигации в HTML-файлах».]]></description>
		<lastBuildDate>Sat, 14 Mar 2015 16:58:34 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92529#p92529</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Не проверял.</p></blockquote></div><p>Я проверил: работает как часы)) Большое спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Sat, 14 Mar 2015 16:58:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92529#p92529</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92507#p92507</link>
			<description><![CDATA[<p>Не проверял.<br /></p><div class="codebox"><pre><code>#SingleInstance Force

^vk51::     ;CTRL + Q для запуска в каталоге (БЕЗ ПОДКАТАЛОГОВ) с HTM-файлами
   File_Path := GetActiveFolderPath()

   FileDelete, %a_desktop%\HTM_NAV.AHK
   n = 0
   Loop, %File_Path%\*.htm, 0, 1
  {
      if (A_LoopFileDir != Dir)
      n++
      list%n% .= A_LoopFileLongPath &quot;`n&quot;
      Dir := A_LoopFileDir
   }
   loop %n%
   {
   back1 := back2 := next1 := next2 := list%A_Index%


;==========================================================================
   StringReplace, back1, back1, `n, :::`n, All
   allback = %back1%%back2%
   Sort, allback
   allback := RegExReplace(allback, &quot;U)(^.*\R)&quot;)                     ; удал перв строку
   StringReplace, allback, allback, `,, ```,, All
   StringReplace, allback, allback, `%, ```%, All
   allback := RegExReplace(allback, &quot;m`a)^.*\\(.*):::(`n)|^\R&quot;, &quot;FileAppend, &lt;table  border=&quot;&quot;0&quot;&quot; cellspacing=&quot;&quot;0&quot;&quot; cellpadding=&quot;&quot;1&quot;&quot; width=&quot;&quot;100```%&quot;&quot; align=&quot;&quot;center&quot;&quot;&gt;&lt;tr&gt;``r``n&lt;td align=&quot;&quot;left&quot;&quot;&gt;&lt;a href=&quot;&quot;$1&quot;&quot; target=&quot;&quot;_self&quot;&quot;&gt;&amp;larr;&lt;/a&gt;&lt;/td&gt;``r``n`, &quot;)   ; отрез пути
   StringReplace, allback, allback, :::`n, `,%a_space%, All
   allback := RegExReplace(allback, &quot;m`a).*?, $&quot;)                    ; удал послед строку

   FileAppend % allback, %a_desktop%\HTM_NAV.AHK, UTF-8
;==========================================================================

   StringReplace, next1, next1, `n, `|`n, All
   StringReplace, next2, next2, `n, :::`n, All
   allnext = %next1%%next2%
   Sort, allnext
   allnext := RegExReplace(allnext, &quot;U)(^.*\R)&quot;)                   ; удал перв строку
   StringReplace, allnext, allnext, `,, ```,, All
   StringReplace, allnext, allnext, `%, ```%, All
   allnext := RegExReplace(allnext, &quot;m`a)^.*\\(.*):::(`n)|^\R&quot;, &quot;FileAppend, &lt;td align=&quot;&quot;right&quot;&quot;&gt;&lt;a href=&quot;&quot;$1&quot;&quot; target=&quot;&quot;_self&quot;&quot;&gt;&amp;rarr;&lt;/a&gt;&lt;/td&gt;``r``n&lt;/tr&gt;&lt;/table&gt;``r``n$2&quot;) ; отрез пути
   StringReplace, allnext, allnext, `|`n, `|, All
   allnext := RegExReplace(allnext, &quot;m`a)^(.*)\|(.*)&quot;, &quot;$2, $1&quot;) ; отрез пути
   allnext := RegExReplace(allnext, &quot;(`n`, \w:.*$)&quot;, &quot;`n&quot;)       ; удал послед строку

   ;в первом файле перед первым next - чтобы открывалась таблица:
   allnext = :%allnext%
   StringReplace, allnext, allnext, :FileAppend`, &lt;td align=&quot;right, FileAppend`, &lt;table  border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; width=&quot;100```%&quot; align=&quot;center&quot;&gt;&lt;tr&gt;``r``n&lt;td align=&quot;right, All

   FileAppend % allnext, %a_desktop%\HTM_NAV.AHK, UTF-8
;==========================================================================

   sleep 1000
   RunWait, %a_desktop%\HTM_NAV.AHK
   FileDelete, %a_desktop%\HTM_NAV.AHK
   list1 =
   back1 =
   back2 =
   allback =
   next1 =
   next2 =
   allnext =
}
return

GetActiveFolderPath()
{
   hActiveHwnd := WinExist(&quot;A&quot;)
   for item in ComObjCreate(&quot;Shell.Application&quot;).Windows
      if (hActiveHwnd = item.hwnd)
         Return item.Document.Folder.Self.Path
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 14 Mar 2015 00:26:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92507#p92507</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92506#p92506</link>
			<description><![CDATA[<p>Любезный Мальцев, а можно показать на примере кода из №21 сообщения, потому что пробовал подставлять, но это не работает?</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Sat, 14 Mar 2015 00:09:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92506#p92506</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92505#p92505</link>
			<description><![CDATA[<p>А чем не устроил код из 20 сообщения?<br /></p><div class="codebox"><pre><code>Loop, D:\test\*.txt, 0, 1
{
   if (A_LoopFileDir != Dir)
      n++
   a%n% .= A_LoopFileLongPath &quot;`n&quot;
   Dir := A_LoopFileDir
}
loop %n%
   msgbox % a%A_Index%</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 13 Mar 2015 22:35:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92505#p92505</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92504#p92504</link>
			<description><![CDATA[<p>Скрипт из моего предыдущего поста по горячей клавише обрабатывает файлы активной папки без подкаталогов, а не худо бы, чтоб файлы и из подпапок обрабатывал.</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Fri, 13 Mar 2015 21:07:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92504#p92504</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92490#p92490</link>
			<description><![CDATA[<p>Напиши на абстрактном примере, что имеешь и что хочешь получить.<br />А иначе вряд ли кто-то поможет.<br />Типа: имею 3 файла.<br /></p><div class="codebox"><pre><code>1.txt
1stroka1
1stroka2
1stroka3

2.txt
2stroka1
2stroka2
2stroka3

3.txt
3stroka1
3stroka2
3stroka3</code></pre></div><p>Хочу получить:<br /></p><div class="codebox"><pre><code>4.txt

1stroka1
1stroka2
1stroka3
2stroka1
2stroka2
2stroka3
3stroka1
3stroka2
3stroka3</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 12 Mar 2015 20:58:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92490#p92490</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92348#p92348</link>
			<description><![CDATA[<p>Всё-таки, как не кручу, а мозаика не складывается. Как это должно быть на конкретном примере, например, том, что ниже? От кода нашего <strong>teadrinker</strong>&#039;а пришлось отказаться, пот что некоторые моменты не удавалось задействовать. <span style="color: red"><strong>Внимание: код реально меняет HTML докУменты, добавляя в конец каждого переходы на следующий/предыдущий</strong>. Кодировка файлов должна быть ANSI</span>:<br /></p><div class="codebox"><pre><code>
#SingleInstance Force

^vk51::     ;CTRL + Q для запуска в каталоге (БЕЗ ПОДКАТАЛОГОВ) с HTM-файлами
   File_Path := GetActiveFolderPath()

   FileDelete, %a_desktop%\HTM_NAV.AHK

   Loop, %File_Path%\*.htm*
   {
      list1 .= A_LoopFileLongPath &quot;`n&quot;
   }
   back1=%list1%
   back2=%list1%
   next1=%list1%
   next2=%list1%

;==========================================================================
   StringReplace, back1, back1, `n, :::`n, All
   allback = %back1%%back2%
   Sort, allback
   allback := RegExReplace(allback, &quot;U)(^.*\R)&quot;)                     ; удал перв строку
   StringReplace, allback, allback, `,, ```,, All
   StringReplace, allback, allback, `%, ```%, All
   allback := RegExReplace(allback, &quot;m`a)^.*\\(.*):::(`n)|^\R&quot;, &quot;FileAppend, &lt;table  border=&quot;&quot;0&quot;&quot; cellspacing=&quot;&quot;0&quot;&quot; cellpadding=&quot;&quot;1&quot;&quot; width=&quot;&quot;100```%&quot;&quot; align=&quot;&quot;center&quot;&quot;&gt;&lt;tr&gt;``r``n&lt;td align=&quot;&quot;left&quot;&quot;&gt;&lt;a href=&quot;&quot;$1&quot;&quot; target=&quot;&quot;_self&quot;&quot;&gt;&amp;larr;&lt;/a&gt;&lt;/td&gt;``r``n`, &quot;)   ; отрез пути
   StringReplace, allback, allback, :::`n, `,%a_space%, All
   allback := RegExReplace(allback, &quot;m`a).*?, $&quot;)                    ; удал послед строку

   FileAppend % allback, %a_desktop%\HTM_NAV.AHK, UTF-8
;==========================================================================

   StringReplace, next1, next1, `n, `|`n, All
   StringReplace, next2, next2, `n, :::`n, All
   allnext = %next1%%next2%
   Sort, allnext
   allnext := RegExReplace(allnext, &quot;U)(^.*\R)&quot;)                   ; удал перв строку
   StringReplace, allnext, allnext, `,, ```,, All
   StringReplace, allnext, allnext, `%, ```%, All
   allnext := RegExReplace(allnext, &quot;m`a)^.*\\(.*):::(`n)|^\R&quot;, &quot;FileAppend, &lt;td align=&quot;&quot;right&quot;&quot;&gt;&lt;a href=&quot;&quot;$1&quot;&quot; target=&quot;&quot;_self&quot;&quot;&gt;&amp;rarr;&lt;/a&gt;&lt;/td&gt;``r``n&lt;/tr&gt;&lt;/table&gt;``r``n$2&quot;) ; отрез пути
   StringReplace, allnext, allnext, `|`n, `|, All
   allnext := RegExReplace(allnext, &quot;m`a)^(.*)\|(.*)&quot;, &quot;$2, $1&quot;) ; отрез пути
   allnext := RegExReplace(allnext, &quot;(`n`, \w:.*$)&quot;, &quot;`n&quot;)       ; удал послед строку

   ;в первом файле перед первым next - чтобы открывалась таблица:
   allnext = :%allnext%
   StringReplace, allnext, allnext, :FileAppend`, &lt;td align=&quot;right, FileAppend`, &lt;table  border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; width=&quot;100```%&quot; align=&quot;center&quot;&gt;&lt;tr&gt;``r``n&lt;td align=&quot;right, All

   FileAppend % allnext, %a_desktop%\HTM_NAV.AHK, UTF-8
;==========================================================================

   sleep 1000
   Run, %a_desktop%\HTM_NAV.AHK

   list1 =
   back1 =
   back2 =
   allback =
   next1 =
   next2 =
   allnext =
return

GetActiveFolderPath()
{
   hActiveHwnd := WinExist(&quot;A&quot;)
   for item in ComObjCreate(&quot;Shell.Application&quot;).Windows
      if (hActiveHwnd = item.hwnd)
         Return item.Document.Folder.Self.Path
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Sat, 07 Mar 2015 09:59:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92348#p92348</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92250#p92250</link>
			<description><![CDATA[<div class="codebox"><pre><code>Loop, D:\test\*.txt, 0, 1
{
   if (A_LoopFileDir != Dir)
      msgbox, novaja papka
   Dir := A_LoopFileDir
   msgbox % A_LoopFileLongPath
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Wed, 04 Mar 2015 19:25:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92250#p92250</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92238#p92238</link>
			<description><![CDATA[<p>А возможна ли рекурсия в подпапки, чтобы при этом программа не рассматривала весь список с подфайлами в качестве единого, а поочередно заглядывая в папки и подпапки, дописывала бы результат по содержанию каждой из них в один определенный файл?</p><p>Т.е. например папка содержит:<br /></p><div class="codebox"><pre><code>
D:\dir\001.htm
D:\dir\002.htm
D:\dir\003.htm
D:\dir\004.htm
D:\dir\005.htm
D:\dir\006.htm
</code></pre></div><p>Её подпапка содержит:<br /></p><div class="codebox"><pre><code>
D:\dir\sub\001.htm
D:\dir\sub\002.htm
D:\dir\sub\003.htm
D:\dir\sub\004.htm
D:\dir\sub\005.htm
D:\dir\sub\006.htm
</code></pre></div><p>А содержание файла, в который собираются результаты, был бы таким:<br /></p><div class="codebox"><pre><code>
FileAppend, 002.htm, D:\dir\001.htm
FileAppend, 003.htm, D:\dir\002.htm
FileAppend, 004.htm, D:\dir\003.htm
FileAppend, 005.htm, D:\dir\004.htm
FileAppend, 006.htm, D:\dir\005.htm
FileAppend, 007.htm, D:\dir\006.htm
FileAppend, 002.htm, D:\dir\sub\001.htm
FileAppend, 003.htm, D:\dir\sub\002.htm
FileAppend, 004.htm, D:\dir\sub\003.htm
FileAppend, 005.htm, D:\dir\sub\004.htm
FileAppend, 006.htm, D:\dir\sub\005.htm
FileAppend, 007.htm, D:\dir\sub\006.htm
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Wed, 04 Mar 2015 08:36:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92238#p92238</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92228#p92228</link>
			<description><![CDATA[<p>Когда запускал, не ожидал виденное увидеть))) Спасибо тебе!</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Tue, 03 Mar 2015 23:19:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92228#p92228</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92185#p92185</link>
			<description><![CDATA[<p>Если я правильно понял задачу, то как-то так:<br /></p><div class="codebox"><pre><code>^vk51::     ;CTRL + Q для запуска в каталоге с HTM-файлами
   File_Path := GetActiveFolderPath()

   list := PrevPath := &quot;&quot;
   Loop, %File_Path%\*.htm
   {
      if A_Index != 1
         list .= (list = &quot;&quot; ? &quot;&quot; : &quot;`n&quot;) . &quot;FileAppend, &quot; . A_LoopFileName . &quot;, &quot; . PrevPath
      PrevPath := A_LoopFileLongPath
   }

   MsgBox, % list
   Return

GetActiveFolderPath()
{
   hActiveHwnd := WinExist(&quot;A&quot;)
   for item in ComObjCreate(&quot;Shell.Application&quot;).Windows
      if (hActiveHwnd = item.hwnd)
         Return item.Document.Folder.Self.Path
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 03 Mar 2015 15:04:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92185#p92185</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92182#p92182</link>
			<description><![CDATA[<p>Мне так вообще ничего непонятно.<br />Нужен пример с исходными файлами и что в итоге надо получить.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 03 Mar 2015 13:04:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92182#p92182</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92180#p92180</link>
			<description><![CDATA[<p>Чтобы строки со следующими файлами, шли в строку с предыдущими (или наоборот), как по действию кода из 11 поста.</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Tue, 03 Mar 2015 11:39:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92180#p92180</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92178#p92178</link>
			<description><![CDATA[<p>Что значит &quot;сводить списки&quot;?</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Tue, 03 Mar 2015 10:41:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92178#p92178</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Расстановка навигации в HTML-файлах]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92177#p92177</link>
			<description><![CDATA[<p>Очень возможно, но я не ухватываю, как там сводить списки.</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Tue, 03 Mar 2015 10:32:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92177#p92177</guid>
		</item>
	</channel>
</rss>
