2015年2月12日木曜日

PPvの連動ビューで除外設定


僕はPPv上から連動ビューをしているのだが、Exeファイル他PPvで表示したくないファイルがある。



情報として不要だし、読み込むときに処理が重くなるので、これを表示しないようにしたい。
そこで、アクティブPPcのカーソル下ファイルの拡張子を判別し、それ以降の処理を止めるスクリプトを作成する。
以下をScriptフォルダに保存

stop.js

//!*script

if (PPx.Extract("%*extract(C\"%%t\")").match(/^(txt|text|howm|jpg|jpeg|bmp|png|gif|cpp|h|c|l|el|html|htm|xyzzy|emacs|scm|ini|vbs|js|py|pyw|cfg|kif)$/i)){
} else {
  PPx.Quit(-1);
}

これは、アクティブPPcのカーソル下ファイルの拡張子が指定したもの以外なら、PPx.Quit(-1)を実行し、それ以降の処理を中止するスクリプト。

僕のやってる連動ビューは

*execute C,*cursor 2, 1,4,B0000,5,B0000 %: *execute C,*ppv -bootid:A -r %%*name(CD,"%%R","%%1")

1.PPcのカーソルを一つ動かす
2.カーソル下のファイルをPPvで表示する

という二段階で実現している。そこで、この2つの処理の真ん中に先のスクリプトを挟み込めば、拡張子判別をして、2の処理を止めれるわけだ。

以下を編集して取込

KV_main = { ; PPvメイン窓
LEFT ,*execute C,*cursor 6,-1,4,B0000,0,B0000 %: *script %0\Script\stop.js %: *execute C,*ppv -bootid:A -r %%*name(CD,"%%R","%%1")
RIGHT ,*execute C,*cursor 6, 1,4,B0000,0,B0000 %: *script %0\Script\stop.js %: *execute C,*ppv -bootid:A -r %%*name(CD,"%%R","%%1")
UP ,*execute C,*cursor 2,-1,4,B0000,5,B0000 %: *script %0\Script\stop.js %: *execute C,*ppv -bootid:A -r %%*name(CD,"%%R","%%1")
DOWN ,*execute C,*cursor 2, 1,4,B0000,5,B0000 %: *script %0\Script\stop.js %: *execute C,*ppv -bootid:A -r %%*name(CD,"%%R","%%1")
SPACE ,*execute C,*script %0\Script\togglemark.js %: *execute C,*cursor 2, 1,4,B0000,5,B0000 %: *script %0\Script\stop.js %: *execute C,*ppv -bootid:A -r %%*name(CD,"%%R","%%1")
\SPACE ,*execute C,*script %0\Script\togglemark.js %: *execute C,*cursor 2,-1,4,B0000,5,B0000 %: *script %0\Script\stop.js %: *execute C,*ppv -bootid:A -r %%*name(CD,"%%R","%%1")
}

0 件のコメント:

コメントを投稿