google検索(その他:秀丸)
6 月 12th, 2007秀丸のマクロを使ってエディタ内の単語をgoogleサーチ
******************************************************
if( selecting ) {
$s = gettext(seltopx,seltopy,selendx,selendy);
} else {
selectword;
$s = gettext(seltopx,seltopy,selendx,selendy);
$s = input( “Google検索”, $s );
}
if( $s == “” ) {
endmacro;
}
$param = “”;
if( #fHmnetex ) {
$percent = “%”;
$and = “&”;
} else {
$percent = “^%%”;
$and = “^&”;
}
#c = strlen( $s );
#i = 0;
while( #i < #c ) {
$param = $param + $percent +
leftstr( hex( ascii( midstr( $s, #i, 1 ) ) ), 2 );
#i = #i + 1;
}
$param = “http://www.google.co.jp/search?q=” + $param +
$and + “ie=Shift_JIS” + $and + “oe=Shift_JIS” +
$and + “hl=ja”;
if( #fHmnetex ) {
openfile $param;
} else {
run getenv(”Comspec”) + ” /c start ” + $param + ” >nul”;
}
endmacro;
******************************************************
これをマクロに登録すれば使用可能。