/* 噂の「なんとか変換」を体験する 実行するとゲート起動。再実行でゲート停止。 拡張用ゲート2として動作。SKKGateの標準スクリプトの起動が前提。 これを入れて『なんとかれとりばー[SPACE]』で変換するより、 標準操作で『れとりばー[TAB][TAB]』とか打つほうが速いぜ? */ W = WScript G = W.CreateObject("SKKGate") S = new ActiveXObject("WScript.Shell") var I, A, id, result for (;;) { // 待機 id = G.Sync(2) // 終了 if (id < 0) { if (id == -2) { S.Popup("停止します") G.Sync(-1, 2) } break } switch (id) { // 変換 case 0: I = G.Get() A = G.Get(2) if (/^なんとか.+/.test(I) && A < 8) { result = nantoka(I.replace(/^なんとか/, ""), A) for (i in result) G.Put(result[i]) } break } } // なんとか変換 function nantoka(index, attr) { var comp = G.Abbrev(index, 8).split(/\r|$/), result = [], i, r if (comp) { for (i in comp) { r = G.Search(comp[i], attr, 1).split(/\r|$/) result = result.concat(r) } } return result }