<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6722&amp;type=atom" />
	<updated>2012-01-24T08:31:56Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6722</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55969#p55969" />
			<content type="html"><![CDATA[<p><strong>Grey,</strong><br />спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2012-01-24T08:31:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55969#p55969</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55949#p55949" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#IfWinActive, ahk_group MyGroup
GroupAdd, MyGroup, ahk_class MozillaWindowClass
GroupAdd, MyGroup, ahk_class Chrome_WidgetWin_0
GroupAdd, MyGroup, ahk_class IEFrame

^vk42:: ; ctrl+b
^vk49:: ; ctrl+i
^vk55:: ; ctrl+u
   If SubStr(A_ThisHotkey, 2)=&quot;vk42&quot;
      Tag:=&quot;b&quot;
   If SubStr(A_ThisHotkey, 2)=&quot;vk49&quot;
      Tag:=&quot;i&quot;
   If SubStr(A_ThisHotkey, 2)=&quot;vk55&quot;
      Tag:=&quot;u&quot;
   TagLength:=StrLen(Tag)
   ClipContent:=ClipboardAll
   Send, ^{Ins}
   Length:=StrLen(Clipboard)
   Send, % &quot;{BS}[&quot;Tag &quot;]+{Ins}[/&quot;Tag &quot;]&quot;
   Clipboard:=ClipContent
   IsTagged:=True
   Return

^$vk5A:: ; ctrl+z
   If !IsTagged
      Send, ^{vk5A}
   Else
   {
      IfWinActive, ahk_class MozillaWindowClass
         Send, % &quot;^{vk5A 4}{Left &quot;Length &quot;}&quot;
      IfWinActive, ahk_class IEFrame
         Send, % &quot;^{vk5A}{Left &quot;Length &quot;}&quot;
      IfWinActive, ahk_class Chrome_WidgetWin_0
         Send, % &quot;{BS &quot;TagLength+3 &quot;}&quot;
             . &quot;{Left &quot;Length &quot;}{BS &quot;TagLength+2 &quot;}&quot;
      IsTagged:=False
   }
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-01-24T02:20:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55949#p55949</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55931#p55931" />
			<content type="html"><![CDATA[<p>Grey,<br />спасибо, а как помимо ctrl+b добавить и ctrl+u и ctrl+i?</p>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2012-01-23T02:42:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55931#p55931</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55930#p55930" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#IfWinActive, ahk_group MyGroup
GroupAdd, MyGroup, ahk_class MozillaWindowClass
GroupAdd, MyGroup, ahk_class Chrome_WidgetWin_0
GroupAdd, MyGroup, ahk_class IEFrame
TagLength:=StrLen(Tag:=&quot;b&quot;)

^vk42:: ; ctrl+b
   ClipContent:=ClipboardAll
   Send, ^{Ins}
   Length:=StrLen(Clipboard)
   Send, % &quot;{BS}[&quot;Tag &quot;]+{Ins}[/&quot;Tag &quot;]&quot;
   Clipboard:=ClipContent
   IsTagged:=True
   Return

^$vk5A:: ; ctrl+z
   If !IsTagged
      Send, ^{vk5A}
   Else
   {
      IfWinActive, ahk_class MozillaWindowClass
         Send, % &quot;^{vk5A 4}{Left &quot;Length &quot;}&quot;
      IfWinActive, ahk_class IEFrame
         Send, % &quot;^{vk5A}{Left &quot;Length &quot;}&quot;
      IfWinActive, ahk_class Chrome_WidgetWin_0
         Send, % &quot;{BS &quot;TagLength+3 &quot;}&quot;
             . &quot;{Left &quot;Length &quot;}{BS &quot;TagLength+2 &quot;}&quot;
      IsTagged:=False
   }
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-01-23T01:41:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55930#p55930</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55921#p55921" />
			<content type="html"><![CDATA[<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>2012-01-22T18:10:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55921#p55921</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55917#p55917" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>А какие отличия должны быть подчеркнуты в описании?<br />IfWinActive — команда, WinActive() — функция, #IfWinActive — директива.<br /><a href="http://l.autohotkey.net/docs/commands/_IfWinActive.htm">#IfWinActive</a>, <a href="http://l.autohotkey.net/docs/commands/IfWinActive.htm">IfWinActive</a> ::en.<br />Действия по условию <em>If WinActive(&quot;ahk_class MozillaWindowClass&quot;) or WinActive(&quot;ahk_class Chrome_WidgetWin_0&quot;)</em> выполнятся в случае если активно окно с классом <strong>MozillaWindowClass</strong> или <strong>Chrome_WidgetWin_0</strong>. <br />Добавить к этому нечего.</p></blockquote></div><p>Ну вот не работает оно. Не знаю почему. У Notepad++ класс явно другой (я даже проверил), но хоткеи срабатывают и в нём.<br />В принципе вопрос решил:<br /></p><div class="codebox"><pre><code>GroupAdd, Browsers, ahk_class MozillaWindowClass
GroupAdd, Browsers, ahk_class Chrome_WidgetWin_0
GroupAdd, Browsers, ahk_class IEFrame

#IfWinActive ahk_group browsers
!sc030::Wrap(&quot;b&quot;) ; Alt+B
!sc016::Wrap(&quot;u&quot;) ; Alt+U
!sc017::Wrap(&quot;i&quot;) ; Alt+I


Wrap(tag)
   {
    OldClipboard := Clipboard
    send, ^{vk43} ; Ctrl+C
    Sleep, 10
    Clipboard := &quot;[&quot; tag &quot;]&quot; . Clipboard . &quot;[/&quot; tag &quot;]&quot;
    send, ^{vk56} ; Ctrl+V
    Clipboard := OldClipboard
	return
    }
	return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2012-01-22T17:55:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55917#p55917</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55913#p55913" />
			<content type="html"><![CDATA[<p>А какие отличия должны быть подчеркнуты в описании?<br />IfWinActive — команда, WinActive() — функция, #IfWinActive — директива.<br /><a href="http://l.autohotkey.net/docs/commands/_IfWinActive.htm">#IfWinActive</a>, <a href="http://l.autohotkey.net/docs/commands/IfWinActive.htm">IfWinActive</a> ::en.<br />Действия по условию <em>If WinActive(&quot;ahk_class MozillaWindowClass&quot;) or WinActive(&quot;ahk_class Chrome_WidgetWin_0&quot;)</em> выполнятся в случае если активно окно с классом <strong>MozillaWindowClass</strong> или <strong>Chrome_WidgetWin_0</strong>. <br />Добавить к этому нечего.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-01-22T17:27:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55913#p55913</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55912#p55912" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>1. По ссылке синтаксис команды описан, в переборе вариантов нет необходимости.<br /></p><div class="codebox"><pre><code>If WinActive(&quot;ahk_class MozillaWindowClass&quot;) or WinActive(&quot;ahk_class Chrome_WidgetWin_0&quot;)</code></pre></div></blockquote></div><p>И в таком случае - срабатывает и в notepad++.<br />Синтаксис описан так, что без примеров использования - мне ничего не понятно. На мой взгляд там всё очень запутано:<br />не описана разница между IfWinActive, If WinActive и #IfWinActive.<br />А примеров там мало (нет примера если нужно указать не одну проверку, а несколько).</p>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2012-01-22T17:12:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55912#p55912</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55910#p55910" />
			<content type="html"><![CDATA[<p>1. По ссылке синтаксис команды описан, в переборе вариантов нет необходимости.<br /></p><div class="codebox"><pre><code>If WinActive(&quot;ahk_class MozillaWindowClass&quot;) or WinActive(&quot;ahk_class Chrome_WidgetWin_0&quot;)</code></pre></div><p>2. Замечательно, поддерживаю.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-01-22T16:59:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55910#p55910</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55909#p55909" />
			<content type="html"><![CDATA[<p>Я не очень в AHK разбираюсь и мне нужна более детальная помощь:<br />1. </p><div class="codebox"><pre><code>If WinActive(&quot;ahk_class MozillaWindowClass&quot;) or (&quot;ahk_class Chrome_WidgetWin_0&quot;)</code></pre></div><p>также как и <br /></p><div class="codebox"><pre><code>IfWinActive, (&quot;ahk_class MozillaWindowClass&quot;) or (&quot;ahk_class Chrome_WidgetWin_0&quot;)</code></pre></div><p>и также как и<br /></p><div class="codebox"><pre><code>IfWinActive, (&quot;MozillaWindowClass|Chrome_WidgetWin_0&quot;)</code></pre></div><p>работает и в Notepad++ почему-то.<br />2. Предлагаю такую: </p><div class="codebox"><pre><code>   OldClipboard := Clipboard
...
произвести действия:
копировать выделенный текст
обрамить его тэгами
вставить уже обрамлённый тегами текст (попутно решив проблему 2.Б.)
...
   Clipboard := OldClipboard</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2012-01-22T16:51:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55909#p55909</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55906#p55906" />
			<content type="html"><![CDATA[<p>1. <a href="http://www.script-coding.com/AutoHotkey/IfWinActive_IfWinNotActive.html">IfWinActive</a><br />2. Предложите концепцию, как получить текст из окна FIrefox, Chrome, IE не используя буфер обмена.<br /> A. <a href="http://www.script-coding.com/AutoHotkey/Clipboard.html">Clipboard</a><br /> B. Однократным нажатием ctrl+z отменить можно именно вставку.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-01-22T16:18:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55906#p55906</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: скрипт для ввода HTML-разметки обрамляющими тегами]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=55903#p55903" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=54">Cкрипт для ввода HTML-разметки обрамляющими тегами</a><br />Как его изменить следующим образом?<br />1. Сделать чтобы срабатывал только в окнах с указанными классами MozillaWindowClass, Chrome_WidgetWin_0 и IEFrame.<br />2. Желательно изменить подход в скрипте таким образом, чтобы он работал не через копировать-вставить, т.к.:<br />&nbsp; &nbsp;А. в буфере обмена в этот момент может быть что-то полезное, что будет утрачено<br />&nbsp; &nbsp;Б. невозможно отменить обрамление тегами однократным нажатием CTRL+Z: требуется 4 нажатия вместо 1.</p>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2012-01-22T15:38:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=55903#p55903</id>
		</entry>
</feed>
