2018年11月11日日曜日

PPxをランチャとして使う⑨移動・コピー・展開先の選択




PPCで選択したファイルを、一行編集で表示したパスに移動/コピー/展開できるようにする。


準備


一行編集の文字列がフォルダかどうか判別するため、isThisFolder.jsを用意(参考:PPxをランチャとして使う⑥フォルダパスをPPcに投げる)。
また、解凍のために、7zipをインストールし、7zG.jsをScriptフォルダにいれる必要がある(参考:ppxmemo- trash / つかさのほえほえ日記 - 7-zip(7zG.exe)で書庫の展開)。

以下を編集して取込。

K_edit = { ; 一行編集/PPe兼用
^\C ,%Os *string o,name=%*edittext %:
 *if !%*script(%0\Script\isThisFolder.js,%so"name") %: *linemessage notfolder %: *stop
 *execute C,*ppcfile !copy,%so"name" %: %k"&F4"
^\M ,%Os *string o,name=%*edittext %:
 *if !%*script(%0\Script\isThisFolder.js,%so"name") %: *linemessage notfolder %: *stop
 *execute C,*ppcfile !move,%so"name" %: %k"&F4"
^\U ,%Os *string o,name=%*edittext %:
 *if !%*script(%0\Script\isThisFolder.js,%so"name") %: *linemessage notfolder %: *stop
 *execute C,*script %0Script\wrap_7zG.js,"%%a8FCDN",%so"name" %: %k"&F4"
}

やり方



  1. PPCで移動させたいファイルをマーク。一つしかないなら、カーソルを置くだけでいい
  2. 一行編集を起動し、移動先を表示
  3. Ctrl+Shift+Mを押す


コピーや展開も同様。

その他


操作先のソフトでなにか作業をすることを考えれば、一行編集を閉じる処理はいらないかも。
その場合、コマンド実行後、Enterを押して操作先のフォルダに行くか、それが不要ならEscを押して一行編集を閉じることになる。

K_edit = { ; 一行編集/PPe兼用
^\C ,%Os *string o,name=%*edittext %:
 *if !%*script(%0\Script\isThisFolder.js,%so"name") %: *linemessage notfolder %: *stop
 *execute C,*ppcfile !copy,%so"name"
^\M ,%Os *string o,name=%*edittext %:
 *if !%*script(%0\Script\isThisFolder.js,%so"name") %: *linemessage notfolder %: *stop
 *execute C,*ppcfile !move,%so"name"
^\U ,%Os *string o,name=%*edittext %:
 *if !%*script(%0\Script\isThisFolder.js,%so"name") %: *linemessage notfolder %: *stop
 *execute C,*script %0Script\wrap_7zG.js,"%%a8FCDN",%so"name"
}

参考


つかさのほえほえ日記 - PPxとfenrirの連携

これまでの設定まとめ



  • 7zipをインストール
  • PPtrayを起動
  • isThidFolder.jsとisThisFIle.jsをScriptフォルダに作成
  • isThisEmpty.jsをScriptフォルダに作成
  • subdirlist.jsをScriptフォルダに作成
  • 7zG.jsをScriptフォルダに作成
  • ファイルパスをまとめたl_cmd.txtをPPxフォルダに作成
  • フォルダパスをまとめたl_dir.txtをPPxフォルダに作成


X_flst = 3,2 ; エントリ補完結果一覧 0:無 1:有 2:OS版 3~5:動的,0:先頭 1:部分

A_exec = { ; エイリアス
NeeView = D:\bin\NeeView\NeeView.exe
aimp = D:\bin\AIMP4\AIMP.exe
xyzzy = D:\bin\xyzzy\xyzzy.exe
weather = *ppv http://wttr.in/kyoto.png
}

K_tray = { ; PPtrayホットキー(キー指定 不可,V_xx 形式を推奨)
^' ' ,*if %*findwindowtitle("PPlauncher") %: *focus !"PPlauncher" %: *stop
 *string o,name=%"PPlauncher"%eh%E %:
 *if %*script(%0\Script\isThisEmpty.js,%so"name") %: *focus %: *stop
 *if %*script(%0\Script\isThisFolder.js,%so"name") %: *ppc -r %so"name" %: *stop
 *if %*script(%0\Script\isThisFile.js,%so"name") %: *execute,"%so"name"" %: *stop
 *execute,%so"name"
}

K_edit = { ; 一行編集/PPe兼用
^\C ,%Os *string o,name=%*edittext %:
 *if !%*script(%0\Script\isThisFolder.js,%so"name") %: *linemessage notfolder %: *stop
 *execute C,*ppcfile !copy,%so"name"
^\M ,%Os *string o,name=%*edittext %:
 *if !%*script(%0\Script\isThisFolder.js,%so"name") %: *linemessage notfolder %: *stop
 *execute C,*ppcfile !move,%so"name"
^\U ,%Os *string o,name=%*edittext %:
 *if !%*script(%0\Script\isThisFolder.js,%so"name") %: *linemessage notfolder %: *stop
 *execute C,*script %0Script\wrap_7zG.js,"%%a8FCDN",%so"name"
^\RIGHT ,%Os *string o,dir=%*edittext %:
 *string o,result=%'temp'%\result.txt %:
 *script %0\Script\subdirlist.js,"%so"dir"","%so"result"" %:
 *completelist /file:"%so"result" %:
 *replace ""
^\LEFT ,%Os *string o,dir=%*name(D,"%*edittext") %:
 *string o,result=%'temp'%\result.txt %:
 *script %0\Script\subdirlist.js,"%so"dir"","%so"result"" %:
 *completelist /file:"%so"result" %:
 *replace ""
^W ,*execute ,%Ob browser  "http://google.jp/search?q=%*edittext&ie=utf-8&oe=utf-8" %: %k"&F4"
F12 ,*ppcust %: %k"&F4"
ESC ,%k"&F4"
FIRSTEVENT ,*completelist /set /file:%0l_cmd.txt %: *completelist /set /file:%0l_dir.txt
}

0 件のコメント:

コメントを投稿