<?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=11044&amp;type=atom" />
	<updated>2016-11-09T14:02:35Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11044</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109025#p109025" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>becauseim пишет:</cite><blockquote><p>правильно ли я сделал</p></blockquote></div><p>Функция timeline() выглядит странно. Почему yCtrl не должно быть равно именно 80? А переменная StateEditing вообще не задана. Как она может быть равна 520?</p><p>Чтобы подсказать, как правильно, нужно Premiere Pro иметь.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-11-09T14:02:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109025#p109025</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=109023#p109023" />
			<content type="html"><![CDATA[<p>Необходимо задать работу горячей клавиши в определенном контроле. Сейчас не работает клавиша <strong>m</strong>, но работает <strong>g</strong>. Подскажите, пожалуйста, в чем ошибка?<br /></p><div class="codebox"><pre><code>timeline()
{
	Global
	IfWinActive ahk_class Premiere Pro
	{
		MouseGetPos,,,, Ctrl, 2
		ControlGetPos, xCtrl, yCtrl,,,, ahk_id %ctrl%
		if ((yCtrl != 80) and (StateEditing = 520))
			{
				return !ErrorLevel
			}
	}
}

#UseHook
Array := [&quot;^+{f2}&quot;, &quot;^+{f7}&quot;, &quot;^+{f5}&quot;, &quot;^+{f6}&quot;, &quot;^+{f1}&quot;], max := Array.MaxIndex()
Return

#If processing
*sc32:: Return
#If

#if timeline()
sc32::   ; m
   KeyWait, % A_ThisHotkey, T0.3
   if !ErrorLevel
      SendInput, {%A_ThisHotkey%}
   else  {
      while GetKeyState(A_ThisHotkey, &quot;P&quot;) &amp;&amp; processing := 1  {
         SendInput, % Array[(k := mod(A_Index, max)) ? k : max]
         Sleep, 500
      }
      processing := &quot;&quot;
   }
   Return

g:: ToolTip g
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2016-11-09T12:08:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=109023#p109023</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98609#p98609" />
			<content type="html"><![CDATA[<p>Не знаю, правильно ли я сделал, но не работает.<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>#SingleInstance Force

ArrVegas:=	{&quot;F2&quot;:{&quot;Label&quot;:&quot;F2&quot;, &quot;Delay&quot;:250}}
		
Hotkey, IfWinActive, ahk_class Vegas.Class.Frame
		
For key in ArrVegas  {
	Hotkey, %key%, Work
	ArrVegas[key][&quot;C&quot;] := 0
}
Return

Work:
	o := ArrVegas[A_ThisHotkey], o[&quot;C&quot;] := A_TickCount - o[&quot;T&quot;] &lt; o[&quot;Delay&quot;] ? o[&quot;C&quot;] + 1 : 1 
	o[&quot;T&quot;] := A_TickCount, IsLabel(o[&quot;Label&quot;] &quot;_&quot; o[&quot;C&quot;]) ? 0 : (o[&quot;C&quot;] := 1) 
	Try Gosub, % o[&quot;Label&quot;] &quot;_&quot; o[&quot;C&quot;]
	Return

F2_1:
	SendInput ^!+k
	Return
			
F2_2:
	SendInput !0+^[
	Return
	
	


#if timeline()
vk44:: SendInput {Delete}
#if

timeline()
{
   IfWinActive ahk_class Vegas.Class.Frame
   {
      ControlGetFocus, control, ahk_class Vegas.Class.Frame
      If Instr(control, &quot;Vegas.Class.Doc&quot;)
         return !ErrorLevel
   }
}

</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2015-10-31T18:26:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98609#p98609</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98608#p98608" />
			<content type="html"><![CDATA[<p>Уже ж написал выше.<br /></p><div class="codebox"><pre><code>Hotkey,IfWinActive,ahk_class Vegas.Class.Frame</code></pre></div><p>Или в 13ой версии окно не меняет названия, при открытии проекта?</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-10-31T18:04:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98608#p98608</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98607#p98607" />
			<content type="html"><![CDATA[<p><strong>Alectric</strong>, не подскажете, как все-таки объединить сценарии в один файл? Чтобы горячая клавиша F2 также была активной.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2015-10-31T18:00:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98607#p98607</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98606#p98606" />
			<content type="html"><![CDATA[<p>Видимо в 12ой версии по другому...</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-10-31T17:58:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98606#p98606</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98605#p98605" />
			<content type="html"><![CDATA[<p><strong>Alectric</strong>, не совсем Вас понял. Первый скрипт должен работать в в окне программы. Второй же работает только в области таймлана, чего удалось добиться благодаря методу от <strong>Malcev</strong>. Оба сценария работают необходимым образом, но только из разных файлов. Располагаясь в одном файле, горячая клавиша из первого сценария уже не активна.</p><p>upd.: Не равносилен, т.к. срабатывает всюду, а не в заданной области.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2015-10-31T17:46:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98605#p98605</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98604#p98604" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Hotkey, IfWinActive, Vegas Pro 13.0
</code></pre></div><p>Название окна разве не меняется при открытии проекта?<br /></p><div class="codebox"><pre><code>Hotkey,IfWinActive,ahk_class Vegas.Class.Frame</code></pre></div><p>...</p><p>На мой взгляд код:<br /></p><div class="codebox"><pre><code>#if timeline()
vk44:: tooltip,Delete
#if

timeline()
{
   IfWinActive ahk_class Vegas.Class.Frame
   {
      ControlGetFocus, control, ahk_class Vegas.Class.Frame
      If Instr(control, &quot;Vegas.Class.Doc&quot;)
         return !ErrorLevel
   }
}
</code></pre></div><p>равносилен:<br /></p><div class="codebox"><pre><code>#IfWinActive ahk_class Vegas.Class.Frame
vk44:: tooltip,Delete
#if
</code></pre></div><p>,т.к. клавиша срабатывает по всей площади окна.</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-10-31T17:43:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98604#p98604</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98601#p98601" />
			<content type="html"><![CDATA[<p>Не получается объединить два скрипта в одном файле. А именно, не работает первый сценарий, который должен работать в окне программы целиком. Как правильно их объединить?<br /></p><div class="codebox"><pre><code>

ArrVegas:=	{&quot;F2&quot;:{&quot;Label&quot;:&quot;F2&quot;, &quot;Delay&quot;:250}}
		
Hotkey, IfWinActive, Vegas Pro 13.0
		
For key in ArrVegas  {
	Hotkey, %key%, Work
	ArrVegas[key][&quot;C&quot;] := 0
}
Return

Work:
	o := ArrVegas[A_ThisHotkey], o[&quot;C&quot;] := A_TickCount - o[&quot;T&quot;] &lt; o[&quot;Delay&quot;] ? o[&quot;C&quot;] + 1 : 1 
	o[&quot;T&quot;] := A_TickCount, IsLabel(o[&quot;Label&quot;] &quot;_&quot; o[&quot;C&quot;]) ? 0 : (o[&quot;C&quot;] := 1) 
	Try Gosub, % o[&quot;Label&quot;] &quot;_&quot; o[&quot;C&quot;]
	Return

F2_1:
	SendInput ^!+k
	Return
			
F2_2:
	SendInput !0+^[
	Return
</code></pre></div><div class="codebox"><pre><code>#if timeline()
vk44:: SendInput {Delete}
#if

timeline()
{
   IfWinActive ahk_class Vegas.Class.Frame
   {
      ControlGetFocus, control, ahk_class Vegas.Class.Frame
      If Instr(control, &quot;Vegas.Class.Doc&quot;)
         return !ErrorLevel
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2015-10-31T17:08:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98601#p98601</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98573#p98573" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#if timeline()
1:: msgbox timeline
#if

timeline()
{
   IfWinActive ahk_class Vegas.Class.Frame
   {
      ControlGetFocus, control, ahk_class Vegas.Class.Frame
      If Instr(control, &quot;Vegas.Class.Doc&quot;)
         return !ErrorLevel
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-30T18:27:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98573#p98573</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98572#p98572" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>У меня в 13 вегасе контрол таймлайна - vegas.class.doc10.</p></blockquote></div><p>Если переместить или добавить &quot;под-окно&quot;, то число в конце меняется. У меня к примеру doc5 - doc4 (если закрыть 1 &quot;под-окно&quot;).</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-10-30T18:21:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98572#p98572</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98570#p98570" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#if timeline()
1:: msgbox timeline
#if

timeline()
{
   IfWinActive ahk_class Vegas.Class.Frame
   {
      ControlGetFocus, control, ahk_class Vegas.Class.Frame
      If (control=&quot;Vegas.Class.Doc10&quot;)
         return !ErrorLevel
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-30T18:06:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98570#p98570</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98568#p98568" />
			<content type="html"><![CDATA[<p>В общем, вариант от <strong>Alectric</strong> работает, но в качестве сокращений его использовать вряд ли получится. Скорость отзывчивости слишком мала.<br />Уважаемый <strong>Malcev</strong> однажды подсказал о таком методе работы с таймлайном в Premiere Pro:<br /></p><div class="codebox"><pre><code>#if timeline()
WheelUp:: Send {=}
WheelDown:: Send {-}
#if

timeline()
{
   IfWinActive ahk_class Premiere Pro
   {
      MouseGetPos, , , id, control    ; узнаем над каким контролом находится мышка
      n := RegExReplace(control, &quot;\D&quot;)   ;  присваиваем переменной номер контрола
      If (n&gt;=19) and (n&lt;=50)   ; n находим опытным путем
         return !ErrorLevel
   }
}</code></pre></div><p>Возможно, есть вероятность интерпретации данного метода?</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2015-10-30T17:53:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98568#p98568</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98567#p98567" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Иногда с большой иногда нет, это минус использования Acc, но других способов я не вижу... пока-что. Т.к. контролы все время меняются и как отдельные окна эти &quot;подокна&quot; не определяются, пока их не отделишь...</p></blockquote></div><p>У меня в 13 вегасе контрол таймлайна - vegas.class.doc10.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-30T17:45:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98567#p98567</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание работы скрипта во встраиваемом окне программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=98566#p98566" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>yalanne пишет:</cite><blockquote><p> try</p></blockquote></div><p>Пока еще не разбирался с &quot;попыткой&quot;, но кажется там &quot;ловить&quot; (catch) нужно обязательно или нет? Да и не понял пока - как это действует &quot;внутри&quot; (всмысле - делает эту ошибку не критической для системы или просто ловит сообщение об ошибке и не выводит на экран, в плане безопасности таких ошибок...).</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-10-30T17:22:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=98566#p98566</id>
		</entry>
</feed>
