<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Отделение первого слова от текста из карточки лингво]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=7823</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7823&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Отделение первого слова от текста из карточки лингво».]]></description>
		<lastBuildDate>Thu, 29 Nov 2012 18:25:42 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Отделение первого слова от текста из карточки лингво]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=66298#p66298</link>
			<description><![CDATA[<p>Вот код, который был изначально скачан с одного блога<br /></p><div class="codebox"><pre><code>AddSelectionAsTranslationToAnki()
{
   IfWinNotExist Add Items ahk_class QWidget
   {
      MsgBox Error: Anki is not running
      return
   }
   
   Send ^c                                 ; Copy selection to clipboard
   Translation = %Clipboard%               ; Save translation
   WinGetTitle, Title, A                   ; Get title of Lingvo card
   Word := RegExReplace(Title, &quot; \(.*\)$&quot;) ; Remove language pair to get word
   
   WinActivate Add Items ahk_class QWidget
   
   Send %Word%         ; Send word to front
   Send {Tab}          ; Skip to back
   Send %Translation%  ; Send translation to back
   
   ; Move mouse to the center of Add Items window
   WinGetPos,,, width, height,A
   center_x:=width/2
   center_y:=height/2
   MouseMove,center_x,center_y
}
 
#IfWinActive ahk_class Lv14_CardFrame
^v::AddSelectionAsTranslationToAnki()
#IfWinActive</code></pre></div><p>Данный код не работает, потому что у меня не видит почему то заголовок окна (окна карточки слова в лингво). Проверял через autospy - на месте заголовка пустое место. Win 7 64. lingvo x3. Цель данного скрипта загонять быстро перевод слова в анки вместе с самим словом по-английски. Поэтому я решил, что нужно просто отделить перевод слова от самого слова по английски и наооборот.<br /></p><div class="codebox"><pre><code>AddSelectionAsTranslationToAnki()
{
   IfWinNotExist Add Items ahk_class QWidget
   {
      MsgBox Error: Anki is not running
      return
   }
   
   Send ^c                                 ; Copy selection to clipboard
   Translation = %Clipboard%               ; Save translation
   ; Здесь я хочу достать с помощью RegExMatch слово и перевод из текста карточки лингво.
   
   WinActivate Add Items ahk_class QWidget
   
   Send %Word%         ; Send word to front
   Send {Tab}          ; Skip to back
   Send %Translation%  ; Send translation to back
   
   ; Move mouse to the center of Add Items window
   WinGetPos,,, width, height,A
   center_x:=width/2
   center_y:=height/2
   MouseMove,center_x,center_y
}
 
#IfWinActive ahk_class Lv14_CardFrame
^v::AddSelectionAsTranslationToAnki()
#IfWinActive</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (reghor)]]></author>
			<pubDate>Thu, 29 Nov 2012 18:25:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=66298#p66298</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Отделение первого слова от текста из карточки лингво]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=66274#p66274</link>
			<description><![CDATA[<p>Выкладывайте свой код, помогём.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Thu, 29 Nov 2012 07:15:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=66274#p66274</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Отделение первого слова от текста из карточки лингво]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=66253#p66253</link>
			<description><![CDATA[<p><span style="color: red">Н</span>еобходимо отделить первое слово из перевода английского слова из словаря лингво. Для примера вот перевод:<br /> drill I [dr&amp;#618;l] 1. 1) бур; бурав; сверло Syn: auger , gimlet 2) дрель; перфоратор electric drill — электрическая дрель hand drill — ручная дрель dentist&#039;s drill — бормашина hammer drill — ручная электрическая дрель с перфоратором<br />Здесь необходимо отделить слово drill от остального тектста и наооборот отделить текст от этого слова. Что то я пробовал, так и не вышло, тупо написав для теста небольшой текст заранее, вроде что то выходило, но когда дело доходит до текста из карточки лингво, ничего не получается.</p>]]></description>
			<author><![CDATA[null@example.com (reghor)]]></author>
			<pubDate>Wed, 28 Nov 2012 21:17:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=66253#p66253</guid>
		</item>
	</channel>
</rss>
