<?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=7823&amp;type=atom" />
	<updated>2012-11-29T18:25:42Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7823</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Отделение первого слова от текста из карточки лингво]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=66298#p66298" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[reghor]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29070</uri>
			</author>
			<updated>2012-11-29T18:25:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=66298#p66298</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Отделение первого слова от текста из карточки лингво]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=66274#p66274" />
			<content type="html"><![CDATA[<p>Выкладывайте свой код, помогём.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2012-11-29T07:15:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=66274#p66274</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Отделение первого слова от текста из карточки лингво]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=66253#p66253" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[reghor]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29070</uri>
			</author>
			<updated>2012-11-28T21:17:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=66253#p66253</id>
		</entry>
</feed>
