Macro/投稿/62 の変更点

http://sakura.qp.land.to/?Macro%2F%C5%EA%B9%C6%2F62


Top > Macro > 投稿 > 62
  • 追加された行はこの色です。
  • 削除された行はこの色です。
  • Macro/投稿/62 へ行く。

* MS-IME単語登録 [#cd14ea2b]
-ページ: [[Macro/投稿]]
-作者: [[りーや]]
-カテゴリー: pls
-投稿日: 2005-07-01 (金) 20:35:24

** メッセージ [#l988b4d5]
拡張モジュール[http://perldoc.jp/docs/modules/Win32-GuiTest-1.3/GuiTest.pod GuiTest]が必要

#code(perl){{
# AddWordIME.pls
use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys);
use Win32::Clipboard;
$CLIP = Win32::Clipboard();
$Win32::GuiTest::debug = 0;
$execComm = "C:\\WINDOWS\\ime\\IMJP8_1\\imjpdct.exe";
@windows = FindWindowLike(0, "\x92\x50\x8c\xea\x2f");
$kanji = GetSelectedString(0);
unless($kanji){
    SelectWord();
    $kanji = GetSelectedString(0);
}
Copy();
if (not @windows) {
    ExecCommand($execComm  , 0 );
    while(not @windows){
        sleep 1;
        @windows = FindWindowLike(0, "\x92\x50\x8c\xea\x2f");
    }
}
$imeWin = shift(@windows);
SetForegroundWindow($imeWin);
SendKeys("{PAUSE 300}");
SendKeys("%g");
SendKeys("^v");
$CLIP->Empty();
SendKeys("+{HOME}");
SendKeys("{F13}", 300);
SendKeys("{ESCAPE}", 200);
SendKeys("{ESCAPE}", 200);
SendKeys("+{END}");
SendKeys("^c");
$kana = $CLIP->GetText();
if($kana == $kanji){
    SendKeys("{F13}", 300);
    SendKeys("{ESCAPE}", 200);
    SendKeys("{ENTER}");
}
SendKeys("+{HOME}");
SendKeys("^c");
$kana = $CLIP->GetText();
SendKeys("{F13}", 300);
SendKeys("{ENTER}");
SendKeys("%y");
SendKeys("^v");
}}

----

#comment

    ホーム 一覧 単語検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS