Macro/投稿/174 のバックアップソース(No.1)



* 任意のブラウザでGoogle検索 [#x50d7977]
-ページ: [[Macro/投稿]]
-作者: [[ac]]
-カテゴリー: js
-投稿日: 2007-08-15 (水) 11:07:21

** メッセージ [#j93c6a5b]
「選択範囲をGoogleで検索」マクロにインスパイアを受けて。
#code(javascript){{
//任意のブラウザのパスに書き換える
var strBrowserPath = "C:\\Program Files\\Opera\\Opera.exe";

strBrowserPath = "\"" + strBrowserPath + "\"";

var keyword = GetSelectedString(0);
if( keyword == ""){
	GetSelectedString(0);
}

//エンコードしてないと失敗するorz
keyword = encodeURIComponent(keyword);

var strUrl = "http://www.google.co.jp/search?hl=ja&inlang=ja&q=" + keyword;
var shell = new ActiveXObject("WScript.Shell");
shell.Run(strBrowserPath + " \"" + strUrl + "\"");

}}
----

#comment

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