<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Закладурки и AutoHotkey — дружба навеки)]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=7053</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7053&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Закладурки и AutoHotkey — дружба навеки)».]]></description>
		<lastBuildDate>Wed, 04 Apr 2012 07:28:46 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[AHK: Закладурки и AutoHotkey — дружба навеки)]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=58808#p58808</link>
			<description><![CDATA[<p>Предназначен для быстрого применения выбранного букмарклета к странице — в зависимости от типа браузера, в котором она открыта.</p><p>Список букмарклет-файлов предполагается создавать в определённой папке с расширениями &quot;.bm&quot;.<br />Пример содержимого такого файла:</p><div class="codebox"><pre><code>
Созданный файл может содержать комментарии — извлечена будет первая найденная строка, начинающаяся на &quot;javascript:&quot;.

Creates a bookmarklet that will take whatever word is currently selected and look it up in the English Wiktionary.

javascript:Wi=document.getSelection(); if (!Wi) {void(Wi=prompt(&#039;Type word for Wiktionary:&#039;,&#039;&#039;))} if (Wi) location.href=&#039;http://en.wiktionary.org/wiki/&#039;+escape(Wi)+&#039; &#039;</code></pre></div><p>Пример названия —<br /></p><div class="quotebox"><blockquote><p>(ie(op(ff(ns(mz&nbsp; Wiktionary Search.bm</p></blockquote></div><p>— где <strong>(ie</strong>, <strong>(op</strong>, <strong>(ff</strong>, <strong>(ns</strong>, <strong>(mz</strong> — возможность совместимости этой конкретной js-процедуры с браузерами <em>Internet Explorer</em>, <em>Opera</em>, <em>Firefox</em>, <em>Netscape Navigator</em>, <em>Mozilla</em> соотв.</p><p>Горячая клавиша — F5</p><div class="codebox"><pre><code>
; Расположение создаваемых букмарклет-файлов
BKMKLTs = %A_ScriptDir%\BKMKLTs\*.bm

GroupAdd, OperaBrows, ahk_class OpWindow ; Opera
GroupAdd, OperaBrows, ahk_class OperaWindowClass ; Opera

GroupAdd, MozillaBrows, ahk_class MozillaUIWindowClass ; FF
GroupAdd, MozillaBrows, ahk_class MozillaWindowClass   ; FF

F5::
Menu, MyMenu, Add, DummyText, MenuHandler

Menu, MyMenu, DeleteAll
Loop, %BKMKLTs%
   Menu, MyMenu, Add, %A_LoopFileName%, MenuHandler
Menu, MyMenu, Show
Return

MenuHandler:
FileRead, BkMk, %A_ScriptDir%\%A_ThisMenuItem%
if not ErrorLevel
{
  TempClipboard:= ClipboardAll
  clipboard =

  Pos = 1
  Pos := RegExMatch(BkMk, &quot;m`a)^javascript\:.*$&quot;, Found, Pos + StrLen(Found))
    Clipboard .= Found . &quot;`n&quot;

  ;Если активна Opera
  If WinActive(&quot;ahk_group OperaBrows&quot;) and If InStr(A_ThisMenuItem, &quot;(op&quot;)
  {
    SendInput, {F8}
    Sleep, 250
    SendInput, {Ctrl Down}{sc2f}{Ctrl Up}   ;v
  }
  ;Internet Explorer
  If WinActive(&quot;ahk_class IEFrame&quot;) and If InStr(A_ThisMenuItem, &quot;(ie&quot;)
  {
    WinActivate, ahk_class IEFrame
    ControlFocus, Edit1, ahk_class IEFrame
    ControlSetText, Edit1, %Clipboard%, ahk_class IEFrame
  }
  ;Mozilla Firefox (не настроено)
  If WinActive(&quot;ahk_group MozillaBrows&quot;) and If InStr(A_ThisMenuItem, &quot;(ff&quot;)
    msgbox %Clipboard%

  Send, {ENTER}
  clipboard =
  BkMk =
  Clipboard:= TempClipboard
}
Return</code></pre></div><p>Кое-что о закладурках: <a href="http://forum.script-coding.com/viewtopic.php?pid=13238#p13238">http://forum.script-coding.com/viewtopi … 238#p13238</a></p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Wed, 04 Apr 2012 07:28:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=58808#p58808</guid>
		</item>
	</channel>
</rss>
