PPvを起動中のPPcの中央に順次移動できるようにする。
以下をScriptフォルダに保存。
next_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 | |
// 引数:[A-Z] | |
// 受け取ったIDの次のPPCIDを返す | |
// 例:%*script(%0Script\next_ppc_id.js,C_A) | |
if (PPx.Arguments.Length < 1){ | |
PPx.SetPopLineMessage("引数が正しくありません。"); | |
PPx.Quit(); | |
} | |
var currentID = PPx.Arguments.Item(0); | |
var nextID = 0; | |
var ppclist = PPx.Extract('%*ppxlist(-C)').split( "," ); | |
ppclist.pop(); | |
// リストがなければ終了 | |
if (ppclist.length < 1){ | |
PPx.SetPopLineMessage("PPCがありません。"); | |
PPx.Quit(); | |
} | |
for(i = 0; i < ppclist.length; i++) { | |
if (ppclist[i]==currentID){ | |
nextID = i; | |
} | |
} | |
// リスト最後なら最初にループ | |
if (nextID == ppclist.length-1) { | |
PPx.Result = ppclist[0]; | |
} else { | |
PPx.Result = ppclist[nextID+1]; | |
} |
以下を編集して取込。
KV_main = { ; PPcメイン窓 ^\RIGHT ,*ifmatch 0,0%*getcust(_User:center_id) %: *setcust _User:center_id=%*rightstr("%*extract(C"%%n")", 1) *string o,currentid=C_%*getcust(_User:center_id) %: *string o,newid=%*script(%0Script\next_ppc_id.js,%so"currentid") %: *string o,handle=%%NC%*rightstr("%so"newid"", 1) %: *fitwindow %*extract("%so"handle""),%N,20 %: *setcust _User:center_id=%*rightstr("%so"newid"", 1) ^\LEFT ,*ifmatch 0,0%*getcust(_User:center_id) %: *setcust _User:center_id=%*rightstr("%*extract(C"%%n")", 1) *string o,currentid=C_%*getcust(_User:center_id) %: *string o,newid=%*script(%0Script\next_ppc_id.js,%so"currentid") %: *string o,handle=%%NC%*rightstr("%so"newid"", 1) %: *fitwindow %*extract("%so"handle""),%N,20 %: *setcust _User:center_id=%*rightstr("%so"newid"", 1) }
PPc[A] PPc[B] PPc[C]の三つが起動していた場合、PPv上でCtrl+Shift+カーソル左右で、
PPc[A]→PPc[B]→PPc[C]→PPc[A]→…
という順序でPPc中央に移動する。
0 件のコメント:
コメントを投稿