Created
November 25, 2011 09:17
-
-
Save hokorobi/1393107 to your computer and use it in GitHub Desktop.
PPx rename
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 | |
if ( PPx.DirectoryType == 96 || PPx.DirectoryType == 4 ) { | |
//UNxxx or listfile | |
PPx.Execute("%K\"@R\"") | |
} else { | |
if ( PPx.EntryFirstMark == 0 ) { | |
// マークがなかったらカーソルのエントリをリネーム。 | |
if(PPx.Extract("%T")) { | |
newfile = PPx.Extract('%"名前変更"%{%|%X%|.%T%}'); | |
} else { | |
newfile = PPx.Extract('%"名前変更"%{%|%C%|%}'); | |
} | |
if (!newfile) { | |
// 未入力ならキャンセル。 | |
PPx.Quit(); | |
} | |
PPx.Execute('*rename %FC,' + newfile + ' %: *jumppath /refreshcache /entry:"' + newfile + '"') | |
} else { | |
// マークがあったら一括リネーム | |
if (PPx.EntryAttributes & 16) { | |
// マークの最初がディレクトリなら、ディレクトリをリネーム | |
option = ' /renamefile:off /renamedirectory:on ' | |
} else { | |
option = ' /renamefile:on /renamedirectory:off ' | |
} | |
// 一括リネーム後には refreshcache でソート状態で表示 | |
PPx.Execute('*file Rename /name:%FCB' + option + '%Or- %: *jumppath /refreshcache /savelocate'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment