<?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=8083&amp;type=atom" />
	<updated>2013-02-15T16:57:12Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8083</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69547#p69547" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>«решение всех задач со строками при помощи регулярных выражений»</p></blockquote></div><p>Так в этом и вопрос, почему-бы и нет? По моей догадке RegEx должны работать быстрее нежели построчный перебор, особенно если искомое находится на двухтысячной строке. Ну и просто это красиво и познавательно (в плане создания паттернов).</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-15T16:57:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69547#p69547</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69544#p69544" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>А почему заменить?</p></blockquote></div><p>А что, решение данной задачи требует применения регулярных выражений?</p><p>Лучше заменить потому, что иначе можно встать на путь «решение всех задач со строками при помощи регулярных выражений» <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2013-02-15T13:44:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69544#p69544</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69543#p69543" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Лучше заменить на что-то вроде</p></blockquote></div><p>Так и было, буква в букву <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />А почему заменить? <br />У вас сомнения по счёт RegExMatch.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-15T13:38:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69543#p69543</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69542#p69542" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>RegExMatch(clipboard, &quot;`am)(?:.*\R){1}\K.+$&quot;, Str)</code></pre></div><p>Лучше заменить на что-то вроде<br /></p><div class="codebox"><pre><code>loop, Parse, Clipboard, `n, `r
    if (A_index = 2) {
        str := A_LoopField
        break
    }
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2013-02-15T13:33:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69542#p69542</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69541#p69541" />
			<content type="html"><![CDATA[<p>Немного сократил код #15 (спасибо creature.ws), и добавил подтверждение на создание файла.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-15T12:52:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69541#p69541</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69535#p69535" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong>, спасибо еще раз, этот вариант прекрасно работает.</p>]]></content>
			<author>
				<name><![CDATA[BgoN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26806</uri>
			</author>
			<updated>2013-02-15T08:30:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69535#p69535</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69532#p69532" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
F5:: 
Send, ^{vk43} 
RegExMatch(clipboard, &quot;`am)(?:.*\R){1}\K.+$&quot;, Str)
MsgBox, 36, Вы хотите создать файл с именем:,  % Str := RegExReplace(Str, &quot;[\\&quot;&quot;/|:?*&lt;&gt;]&quot;, &quot; &quot;) . &quot;.vkp&quot;
IfMsgBox Yes
FileAppend, %clipboard%, C:\%Str%
return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-15T01:08:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69532#p69532</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69531#p69531" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Ещё вопрос: а зачем вы сначала создаёте файл с одним именем, и сразу его переименовываете. Создайте сразу с нужным именем.</p></blockquote></div><p>Да я так и хотел, но только так у меня что-то получалось... Из буфера не мог выдернуть имя файла.</p>]]></content>
			<author>
				<name><![CDATA[BgoN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26806</uri>
			</author>
			<updated>2013-02-15T00:52:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69531#p69531</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69530#p69530" />
			<content type="html"><![CDATA[<p>Работает, только не получается заменить символ &quot;¦&quot; на простой пробел.</p>]]></content>
			<author>
				<name><![CDATA[BgoN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26806</uri>
			</author>
			<updated>2013-02-15T00:50:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69530#p69530</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69529#p69529" />
			<content type="html"><![CDATA[<p>Ещё вопрос: а зачем вы сначала создаёте файл с одним именем, и сразу его переименовываете. Создайте сразу с нужным именем.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-15T00:42:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69529#p69529</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69528#p69528" />
			<content type="html"><![CDATA[<p>Может иногда со старым именем совпадение, переписывайте файл:<br /></p><div class="codebox"><pre><code>FileMove, C:\My Text File.vkp, C:\%String%.vkp, 1</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-15T00:37:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69528#p69528</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69527#p69527" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
F5::
clipboard=
Send, ^{vk43}
String = %clipboard%
String := RegExReplace(String, &quot;[\\&quot;&quot;/|:?*&lt;&gt;]&quot;, &quot;¦&quot;)
FileAppend, %String%, C:\My Text File.vkp
Sleep 100
FileReadLine, String, C:\My Text File.vkp, 2
MsgBox Имя файла будет:`r&quot;C:\%String%.vkp&quot;
Sleep 100
FileMove, C:\My Text File.vkp, C:\%String%.vkp 
MsgBox, Работа окончена.
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-15T00:32:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69527#p69527</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69526#p69526" />
			<content type="html"><![CDATA[<p>Я был не прав, а вы правы. Нужно было исключить недопустимые символы, натыкается на них и из за этого проблемы.</p>]]></content>
			<author>
				<name><![CDATA[BgoN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26806</uri>
			</author>
			<updated>2013-02-15T00:31:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69526#p69526</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69525#p69525" />
			<content type="html"><![CDATA[<p>Не успевает - значит с паузами пробуйте, средство отладки оно же MsgBox, есть:<br /></p><div class="codebox"><pre><code>F5::
Send, ^{vk43}
FileAppend, %clipboard%, C:\My Text File.vkp
Sleep 100
FileReadLine, String, C:\My Text File.vkp, 2
MsgBox Имя файла будет:`r &quot;C:\%String%.vkp&quot;
Sleep 100
FileMove, C:\My Text File.vkp, C:\%String%.vkp 
MsgBox, Работа окончена.
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-02-15T00:25:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69525#p69525</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сохранить выделенный текст в файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=69524#p69524" />
			<content type="html"><![CDATA[<p>Когда нажимаю F5, сохраняется файл &quot;My Text File&quot; и больше ничего не происходит, похоже на то что не успевает переименовать.</p>]]></content>
			<author>
				<name><![CDATA[BgoN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26806</uri>
			</author>
			<updated>2013-02-15T00:19:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=69524#p69524</id>
		</entry>
</feed>
