xyzzyを移動する時、一々マウスを使うのは面倒なので、キーボード操作で移動できるようにする。 移動位置の基準には、ほえほえ日記を見ている人はまず間違いなく2つや3つは常時起動してるはずの、PPcを使う。
PPx側の設定
以下をScriptフォルダに保存。
rotate_ppc_id.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//!*script | |
// 起動しているPPcidを順次返すスクリプト | |
// %*script(%0Script\rotate_ppc_id.js,id)とすると、C_A C_B C_C C_A...と返す | |
// idは現在何番目を実行したかを記憶するための識別子。_Userに保存される | |
if (PPx.Arguments.Length < 1){ | |
PPx.SetPopLineMessage("引数が正しくありません。"); | |
PPx.Quit(); | |
} | |
var ppclist = PPx.Extract('%*ppxlist(-C)').split( "," ); | |
ppclist.pop(); | |
// リストがなければ終了 | |
if (ppclist.length < 1){ | |
PPx.SetPopLineMessage("PPCがありません。"); | |
PPx.Quit(); | |
} | |
var id = PPx.Arguments.Item(0); | |
var currentppc = PPx.Extract("%*getcust(_User:"+id+")"); | |
var nextppc = 0; | |
// 引数が空なら一番目の要素を返す | |
if (currentppc == ""){ | |
PPx.Execute("*setcust _User:"+id+"="+ppclist[0]); | |
PPx.Result = ppclist[0]; | |
PPx.Quit(); | |
} | |
for(i = 0; i < ppclist.length; i++) { | |
if (ppclist[i]==currentppc){ | |
nextppc = i; | |
} | |
} | |
// リスト最後なら最初にループ | |
if (nextppc == ppclist.length-1) { | |
PPx.Execute("*setcust _User:"+id+"="+ppclist[0]); | |
PPx.Result = ppclist[0]; | |
} else { | |
PPx.Execute("*setcust _User:"+id+"="+ppclist[nextppc+1]); | |
PPx.Result = ppclist[nextppc+1]; | |
} |
以下を編集して取り込み。
_Command = { ; ユーザコマンド・関数 xyzzypos = *string o,handle=%%N%*script(%0Script\rotate_ppc_id.js,xyzzyid) *fitwindow %*extract("%so"handle""),%*findwindowtitle("-xyzzy-"),20 }
xyzzy側の設定
以下を.xyzzyに追加。
(setq-default title-bar-format "-xyzzy-") (set-extended-key-translate-table exkey-S-tab #\F20) (global-set-key '#\F20 #'(lambda () (interactive) (call-process "D:\\bin\\ppx\\PPTRAYW.EXE -c *xyzzypos")))
やり方
PPc[A] PPc[B] PPc[C]の三つが起動していた場合、xyzzy上でShift+Tabで、
PPc[A]→PPc[B]→PPc[C]→PPc[A]→…
という順序でPPc中央に移動する。
0 件のコメント:
コメントを投稿