<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Работа с текстом]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=6939</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6939&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Работа с текстом».]]></description>
		<lastBuildDate>Sun, 18 Mar 2012 09:59:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Работа с текстом]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=58010#p58010</link>
			<description><![CDATA[<p><strong>Malcev</strong> <br />Большое Спасибо за помощь новичку.</p>]]></description>
			<author><![CDATA[null@example.com (shveicar)]]></author>
			<pubDate>Sun, 18 Mar 2012 09:59:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=58010#p58010</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с текстом]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=58005#p58005</link>
			<description><![CDATA[<p>С буфером обмена как-раз таки работает.<br />Просто в конце скрипта надо добавить комманду рефреша Тотал Командера - Reread Source - Ctrl+R</p><div class="codebox"><pre><code>f11::
clipboard =
Send, ^{vk43}   ; Ctrl + C
ClipWait, 2
if ErrorLevel
{
   MsgBox, Буфер обмена пуст!
   Return
}
Loop, parse, clipboard, `n, `r
{
   FileRead, Text, %clipboard%
   Sort, Text, U
   FileAppend, %Text%, %clipboard%_Target.txt
   Send, ^{vk52}     ; Ctrl + R
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 17 Mar 2012 22:37:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=58005#p58005</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с текстом]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=58004#p58004</link>
			<description><![CDATA[<p>Спасибо - <strong>Malcev</strong> <br />С буфером обмена, Мне идея больше нравиться, жаль только не работает, ну буду читать и изучать темы.:rolleyes: Спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (shveicar)]]></author>
			<pubDate>Sat, 17 Mar 2012 22:13:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=58004#p58004</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с текстом]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=58002#p58002</link>
			<description><![CDATA[<p><strong>shveicar</strong><br />То, что за основу вы желаете взять код обсуждавшийся в этой теме, не делает ваш вопрос соответствующим заголовку темы.</p><p>Все «недостающие части кода» разобраны в коллекции, очень рекомендую <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Sat, 17 Mar 2012 20:47:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=58002#p58002</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с текстом]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=58001#p58001</link>
			<description><![CDATA[<div class="codebox"><pre><code>f11::
sel := Explorer_GetSelected()
Loop, parse, sel, `n, `r
{
   FileRead, Text, %A_LoopField%
   Sort, Text, U
   FileAppend, %Text%, %A_LoopField%_Target.txt
}
return
 
Explorer_GetPath(hwnd=&quot;&quot;)
{
   if !(window := Explorer_GetWindow(hwnd))
      return ErrorLevel := &quot;ERROR&quot;
   if (window=&quot;desktop&quot;)
      return A_Desktop
   path := window.LocationURL
   path := RegExReplace(path, &quot;ftp://.*@&quot;,&quot;ftp://&quot;)
   StringReplace, path, path, file:///
   StringReplace, path, path, /, \, All
 
   ; thanks to polyethene
   Loop
      If RegExMatch(path, &quot;i)(?&lt;=%)[\da-f]{1,2}&quot;, hex)
         StringReplace, path, path, `%%hex%, % Chr(&quot;0x&quot; . hex), All
      Else Break
   return path
}
Explorer_GetAll(hwnd=&quot;&quot;)
{
   return Explorer_Get(hwnd)
}
Explorer_GetSelected(hwnd=&quot;&quot;)
{
   return Explorer_Get(hwnd,true)
}
 
Explorer_GetWindow(hwnd=&quot;&quot;)
{
   ; thanks to jethrow for some pointers here
    WinGet, process, processName, % &quot;ahk_id&quot; hwnd := hwnd? hwnd:WinExist(&quot;A&quot;)
    WinGetClass class, ahk_id %hwnd%
 
   if (process!=&quot;explorer.exe&quot;)
      return
   if (class ~= &quot;(Cabinet|Explore)WClass&quot;)
   {
      for window in ComObjCreate(&quot;Shell.Application&quot;).Windows
         if (window.hwnd==hwnd)
            return window
   }
   else if (class ~= &quot;Progman|WorkerW&quot;)
      return &quot;desktop&quot; ; desktop found
}
Explorer_Get(hwnd=&quot;&quot;,selection=false)
{
   if !(window := Explorer_GetWindow(hwnd))
      return ErrorLevel := &quot;ERROR&quot;
   if (window=&quot;desktop&quot;)
   {
      ControlGet, hwWindow, HWND,, SysListView321, ahk_class Progman
      if !hwWindow ; #D mode
         ControlGet, hwWindow, HWND,, SysListView321, A
      ControlGet, files, List, % ( selection ? &quot;Selected&quot;:&quot;&quot;) &quot;Col1&quot;,,ahk_id %hwWindow%
      base := SubStr(A_Desktop,0,1)==&quot;\&quot; ? SubStr(A_Desktop,1,-1) : A_Desktop
      Loop, Parse, files, `n, `r
      {
         path := base &quot;\&quot; A_LoopField
         IfExist %path% ; ignore special icons like Computer (at least for now)
            ret .= path &quot;`n&quot;
      }
   }
   else
   {
      if selection
         collection := window.document.SelectedItems
      else
         collection := window.document.Folder.Items
      for item in collection
         ret .= item.path &quot;`n&quot;
   }
   return Trim(ret,&quot;`n&quot;)
}</code></pre></div><p>Или используя буфер обмена</p><div class="codebox"><pre><code>f11::
clipboard =
Send, ^{vk43}   ; Ctrl + C
ClipWait, 2
if ErrorLevel
{
   MsgBox, Буфер обмена пуст!
   Return
}
Loop, parse, clipboard, `n, `r
{
   FileRead, Text, %clipboard%
   Sort, Text, U
   FileAppend, %Text%, %clipboard%_Target.txt
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 17 Mar 2012 20:44:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=58001#p58001</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с текстом]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=57998#p57998</link>
			<description><![CDATA[<p>Здравствуйте.<br />Буквально на днях открыл для себя этот замечательный язык. для сравнения - данное действие на vbs занимает целых 22 строчки!!<br />но вот ведь проблема,&nbsp; - после компиляции - мини программа с таким кодом (добавил в скрипт горячую клавишу) обрабатывает только текстовой файл с именем Source.txt и только при условии, что он лежит в той-же папке. Пользуюсь total comander, - подскажите как сделать, чтобы обрабатывался любой выделенный текстовой файл под курсором, и результат сохранялся в ту-же панель (имя готового файла -значения не имеет). Заранее благодарен. Спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (shveicar)]]></author>
			<pubDate>Sat, 17 Mar 2012 20:11:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=57998#p57998</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с текстом]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=57859#p57859</link>
			<description><![CDATA[<p>В точку!<br />а то я уже на 70 строк надумал... <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (ilya20069)]]></author>
			<pubDate>Thu, 15 Mar 2012 06:45:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=57859#p57859</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Работа с текстом]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=57854#p57854</link>
			<description><![CDATA[<div class="codebox"><pre><code>FileRead, Text, Source.txt
Sort, Text, U
FileAppend, %Text%, Target.txt</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 15 Mar 2012 01:35:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=57854#p57854</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Работа с текстом]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=57852#p57852</link>
			<description><![CDATA[<p>Приветствую, понадобилось найти и удалить в текстовом файле все одиинаковые строки.<br />Но я решил не изобретать велосипед, наверняка с этим уже кто-то сталкивался.<br />Поиском по форуму подобных тем не нашел, прошу подсказать куда копать.<br />Благодарю.</p>]]></description>
			<author><![CDATA[null@example.com (ilya20069)]]></author>
			<pubDate>Wed, 14 Mar 2012 20:21:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=57852#p57852</guid>
		</item>
	</channel>
</rss>
