<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: скрипт для SDL Trados]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=17726</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17726&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: скрипт для SDL Trados».]]></description>
		<lastBuildDate>Tue, 11 Apr 2023 06:30:42 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: скрипт для SDL Trados]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=157519#p157519</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Спасибо. попробую.</p>]]></description>
			<author><![CDATA[null@example.com (serhiyka)]]></author>
			<pubDate>Tue, 11 Apr 2023 06:30:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=157519#p157519</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: скрипт для SDL Trados]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=157503#p157503</link>
			<description><![CDATA[<p>Вот есть <a href="https://www.autohotkey.com/boards/viewtopic.php?p=458015#p458015">такой</a> скрипт <strong>Malcev</strong>&#039;а, может, будет для вас полезен.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 07 Apr 2023 21:30:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=157503#p157503</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: скрипт для SDL Trados]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=157499#p157499</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />В поисках решения ошибки в скрипте обнаружил, что Вы, в свое время, написали подобный скрипт. Конечно, Ваш скрипт выполнен на высоком профессиональном уровне (Java), имея нулевые навыки программирования, я даже не знаю, как запускаются json-скрипты. Мне нужен более простой скрипт, запускаемый из Trados комбинацией клавиш, с возможностью выбора исходного и целевого языка, отправляющий выделенный текст в DeepL вместо Google, и вставляющий уже переведенный текст по месту курсора.<br />Мне кажется. ошибка в скрипте связана с использованием IE, но MS Edge привязать не удалось, получалось еще хуже.</p>]]></description>
			<author><![CDATA[null@example.com (serhiyka)]]></author>
			<pubDate>Fri, 07 Apr 2023 03:51:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=157499#p157499</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: скрипт для SDL Trados]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=157497#p157497</link>
			<description><![CDATA[<p>Спасибо, а какое отношение SDL Trados имеет к вашему скрипту? И я так и не понял, как она связана с DeepL. Это же вроде разные организации?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 06 Apr 2023 20:33:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=157497#p157497</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: скрипт для SDL Trados]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=157495#p157495</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />SDL Trados - одна из лучших CAT(Computer-Aided Translation)-программ. DeepL - лучший на сегодняшний день онлайн-переводчик, значительно сокращающий время перевода.</p>]]></description>
			<author><![CDATA[null@example.com (serhiyka)]]></author>
			<pubDate>Thu, 06 Apr 2023 17:39:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=157495#p157495</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: скрипт для SDL Trados]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=157493#p157493</link>
			<description><![CDATA[<p>А что такое SDL Trados и как это связано с DeepL?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 06 Apr 2023 16:25:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=157493#p157493</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: скрипт для SDL Trados]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=157492#p157492</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Заголовок поправил.</p>]]></description>
			<author><![CDATA[null@example.com (serhiyka)]]></author>
			<pubDate>Thu, 06 Apr 2023 15:23:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=157492#p157492</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: скрипт для SDL Trados]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=157489#p157489</link>
			<description><![CDATA[<p><strong>serhiyka</strong>, добро пожаловать на форум! Ознакомьтесь, пожалуйста, с <a href="https://forum.script-coding.com/misc.php?action=rules">Правилами</a>, отредактируйте свой пост. Обратите внимание на <a href="https://forum.script-coding.com/viewtopic.php?id=5421">составление заголовков</a>.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 06 Apr 2023 10:02:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=157489#p157489</guid>
		</item>
		<item>
			<title><![CDATA[AHK: скрипт для SDL Trados]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=157488#p157488</link>
			<description><![CDATA[<p>Есть скрипт, суть которого состоит в переводе выделенного текста в онлайн-переводчике с последующей вставкой перевода. Скрипт частично работает: запускается окошко с выбором исходного и целевого языков. После нажатия горячей клавиши появляется и через секунду исчезает подсказка: &quot;Translating...&quot;, а дальше - ничего, скрипт висит в трее, перевод не вставляется. Помогите обнаружить ошибку, в AHK разбираюсь слабо.<br /></p><div class="codebox"><pre><code>#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode, 3

ToolTipVisible = 0
Gui, 1:Add, Text, x10 y15 vTb1, Source language:
Gui, 1:Add, Combobox, x+20 yp-3 vLangIn, auto||en|ru|uk
Gui, 1:Add, Text, x10 y+15 vTb2, Target language:
Gui, 1:Add, Combobox, x+22 yp-3 vLangOut, en|ru|uk||
Gui, 1:Add, Checkbox, x10 y+20 Checked vPaste2CB, Paste translation to clipboard when closing tooltip
Gui, 1:Add, Checkbox, x10 y+15 Checked vHideToolTip, Hide tooltip on mouseclick
Gui, 1:Add, Button, x30 y+20 w80 vB1, &amp;Exit
Gui, 1:Add, Button, x+30 w80 Default vB2, &amp;OK
Gui, 1:Show, Autosize
Return

ButtonExit:
GuiEscape:
GuiClose:
ExitApp

ButtonOK:
Gui, 1:Submit
Return

; [Ctrl]+[Alt]+[F11] shows the little user interface for changing source and target language
^!F11::
Gui, 1:Show, Autosize
Return

~RButton::
~MButton::
~LButton::
If HideToolTip = 0
    Return
If ToolTipVisible = 1
{
    ToolTip
    ToolTipVisible = 0
    Return
}
Return

; [Ctrl]+[F11] runs DeepL translator for selected text or makes the tooltip with the translation disappear if it is visible
^F11::
If ToolTipVisible = 1
{
    ToolTip
    ToolTipVisible = 0
    Return
}
CurrentCB = %Clipboard%
Clipboard =
SendInput, ^c
ClipWait, 5
If ErrorLevel
{
    MsgBox, 48, DeepLTranslateSelection, No text highlighted or problem copying text to clipboard.
    Return
}
Source = %Clipboard%
StringLen, SourceLength, Source
SourceLength := SourceLength * 5
ToolTip, Translating... please wait ☺., % A_CaretX-SourceLength, % A_CaretY+50
Target =
Target := DeepLTranslate(Source,LangIn,LangOut)
ToolTip, %Target%, % A_CaretX-SourceLength, % A_CaretY+50
ToolTipVisible = 1
If Paste2CB = 1
    Clipboard = %Target%
Else
    Clipboard = %CurrentCB%
Return

DeepLTranslate(Source,LangIn,LangOut)
{
    StringReplace, Source, Source, %A_Space%, `%20, All
    Base := &quot;https://www.deepl.com/translator&quot;
    Path := Base . &quot;/&quot; . LangIn . &quot;-&quot; . LangOut . &quot;/&quot; . Source
    IE := ComObjCreate(&quot;InternetExplorer.Application&quot;) ; Creation of hidden IE instance to look up DeepL Translate and retrieve 

translation
    IE.Navigate(Path)
    While IE.readyState!=4 || IE.document.readyState!=&quot;complete&quot; || IE.busy
        Sleep 250
    Result := &quot;&quot;
    btns := IE.document.getElementsByClassName(&quot;lmt__translations_as_text__text_btn&quot;)
    if (btns.length &gt; 0) {
        Result := btns[0].innerText
    }
    IE.Quit
    Return Result
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serhiyka)]]></author>
			<pubDate>Thu, 06 Apr 2023 06:01:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=157488#p157488</guid>
		</item>
	</channel>
</rss>
