2008年3月6日木曜日

sakuraエディタのマクロ設定

やはりこういうのを使いこなさねばと思い。

設定->共通設定を選択
マクロタブを押し、マクロ一覧のディレクトリを
C:\Program Files\sakura\macro\
に設定し、
名前:URLエンコード ID:0 urlencode.js
名前:URL デコード ID:1 urldecode.js
と設定。

これにより、登録済みマクロから実行ができる。

ちなみに登録したマクロは下記二つ。

urldecode.js
//URLEncode.js
var oWsh = new ActiveXObject("WScript.Shell");
var sBuf;
sBuf = ExpandParameter("$C")
InsText(sBuf+"\n"+decodeURIComponent(sBuf));
//EOF




urlencode.js
//URLEncode.js
var oWsh = new ActiveXObject("WScript.Shell");
var sBuf;
sBuf = ExpandParameter("$C")
InsText(sBuf+"\n"+encodeURIComponent(sBuf));
//EOF