Code: Select all
if(substr(tab("get", "path"), 0, 3) = E:\);
Tab("rename", "<folder>|<xypath>\icon\XYplorer.ico", Tab("get"))
Is this possible?
Code: Select all
if(substr(tab("get", "path"), 0, 3) = E:\);
Tab("rename", "<folder>|<xypath>\icon\XYplorer.ico", Tab("get"))
Code: Select all
while ("<clipboard>" != "<xx>") {
wait 10;
if(substr(tab("get", "path"), 0) LikeI "Desktop") { Tab("rename", "<curfolder>|<xypath>\icon\Desktop.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 25) LikeI "D:\KPMG\To be transferred") { Tab("rename", "<curfolder>|<xypath>\icon\heart.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 6) LikeI "D:\Doc") { Tab("rename", "<curfolder>|<xypath>\icon\book.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 10) LikeI "D:\Picture") { Tab("rename", "<curfolder>|<xypath>\icon\camera.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 8) LikeI "D:\Movie") { Tab("rename", "<curfolder>|<xypath>\icon\video camera.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 31) LikeI "D:\KPMG\Job\S2a\VPB 30-Jun\VPBS") { Tab("rename", "VPBS2012\<curfolder>|<xypath>\icon\VPB.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 30) LikeI "?:\7Utilities\Video edit magic") { Tab("rename", "<curfolder>|<xypath>\icon\Playboy.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 21) LikeI "D:\KPMG\Job\S2\VPBank") { Tab("rename", "VPB\<curfolder>|<xypath>\icon\VPB.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 8) LikeI "D:\Music") { Tab("rename", "<curfolder>|<xypath>\icon\Music.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 3) LikeI "c:\") { Tab("rename", "<curfolder>|<xypath>\icon\C.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 8) LikeI "?:\1Game") { Tab("rename", "<curfolder>|<xypath>\icon\1Game.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 10) LikeI "?:\2System") { Tab("rename", "<curfolder>|<xypath>\icon\2System.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 10) LikeI "?:\3Office") { Tab("rename", "<curfolder>|<xypath>\icon\3Office.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 9) LikeI "?:\4Media") { Tab("rename", "<curfolder>|<xypath>\icon\4Media.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 10) LikeI "?:\5Design") { Tab("rename", "<curfolder>|<xypath>\icon\5Design.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 12) LikeI "?:\6Internet") { Tab("rename", "<curfolder>|<xypath>\icon\6Internet.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 22) LikeI "?:\7Utilities\XYplorer") { Tab("rename", "<curfolder>|<xypath>\icon\XYplorer.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 33) LikeI "?:\7Utilities\Launcher\AutoHotkey") { Tab("rename", "<curfolder>|<xypath>\icon\AutoHotkey.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 13) LikeI "?:\7Utilities") { Tab("rename", "<curfolder>|<xypath>\icon\7Utilities.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 3) LikeI "k:\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 3) LikeI "i:\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 3) LikeI "g:\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 3) LikeI "h:\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico", Tab("get")); }
elseif(substr(tab("get", "path"), 0, 2) LikeI "\\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico", Tab("get")); }
elseif(1=1) { Tab("rename", tab("get", "path"), Tab("get")); }
}Code: Select all
while ("<clipboard>" != "<xx>") {
wait 10;
$path = tab("get", "path");
if( substr($path, 0) LikeI "Desktop") { Tab("rename", "<curfolder>|<xypath>\icon\Desktop.ico"); }
elseif(substr($path, 0, 25) LikeI "D:\KPMG\To be transferred") { Tab("rename", "<curfolder>|<xypath>\icon\heart.ico"); }
elseif(substr($path, 0, 6) LikeI "D:\Doc") { Tab("rename", "<curfolder>|<xypath>\icon\book.ico"); }
elseif(substr($path, 0, 10) LikeI "D:\Picture") { Tab("rename", "<curfolder>|<xypath>\icon\camera.ico"); }
elseif(substr($path, 0, 8) LikeI "D:\Movie") { Tab("rename", "<curfolder>|<xypath>\icon\video camera.ico"); }
elseif(substr($path, 0, 31) LikeI "D:\KPMG\Job\S2a\VPB 30-Jun\VPBS") { Tab("rename", "VPBS2012\<curfolder>|<xypath>\icon\VPB.ico"); }
elseif(substr($path, 0, 30) LikeI "?:\7Utilities\Video edit magic") { Tab("rename", "<curfolder>|<xypath>\icon\Playboy.ico"); }
elseif(substr($path, 0, 21) LikeI "D:\KPMG\Job\S2\VPBank") { Tab("rename", "VPB\<curfolder>|<xypath>\icon\VPB.ico"); }
elseif(substr($path, 0, 8) LikeI "D:\Music") { Tab("rename", "<curfolder>|<xypath>\icon\Music.ico"); }
elseif(substr($path, 0, 3) LikeI "c:\") { Tab("rename", "<curfolder>|<xypath>\icon\C.ico"); }
elseif(substr($path, 0, 8) LikeI "?:\1Game") { Tab("rename", "<curfolder>|<xypath>\icon\1Game.ico"); }
elseif(substr($path, 0, 10) LikeI "?:\2System") { Tab("rename", "<curfolder>|<xypath>\icon\2System.ico"); }
elseif(substr($path, 0, 10) LikeI "?:\3Office") { Tab("rename", "<curfolder>|<xypath>\icon\3Office.ico"); }
elseif(substr($path, 0, 9) LikeI "?:\4Media") { Tab("rename", "<curfolder>|<xypath>\icon\4Media.ico"); }
elseif(substr($path, 0, 10) LikeI "?:\5Design") { Tab("rename", "<curfolder>|<xypath>\icon\5Design.ico"); }
elseif(substr($path, 0, 12) LikeI "?:\6Internet") { Tab("rename", "<curfolder>|<xypath>\icon\6Internet.ico"); }
elseif(substr($path, 0, 22) LikeI "?:\7Utilities\XYplorer") { Tab("rename", "<curfolder>|<xypath>\icon\XYplorer.ico"); }
elseif(substr($path, 0, 33) LikeI "?:\7Utilities\Launcher\AutoHotkey") { Tab("rename", "<curfolder>|<xypath>\icon\AutoHotkey.ico"); }
elseif(substr($path, 0, 13) LikeI "?:\7Utilities") { Tab("rename", "<curfolder>|<xypath>\icon\7Utilities.ico"); }
elseif(substr($path, 0, 3) LikeI "k:\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico"); }
elseif(substr($path, 0, 3) LikeI "i:\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico"); }
elseif(substr($path, 0, 3) LikeI "g:\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico"); }
elseif(substr($path, 0, 3) LikeI "h:\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico"); }
elseif(substr($path, 0, 2) LikeI "\\") { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico"); }
else { Tab("rename", $path); }
}Yeah it does, see my post.PeterH wrote:And by the way: I wouldn't like to have such an always running script - not sure if it affects XY in some way?
Ahhh - I was too lazy when writingserendipity wrote:Yeah it does, see my post.PeterH wrote:And by the way: I wouldn't like to have such an always running script - not sure if it affects XY in some way?
1) I can load other scripts at the same time (either via Scripting > Load selected script file or via shortcut keys), don't know why not work for you.serendipity wrote:Glad this workaround works for you and thanks for sharing.
I have tried something similar before but never shared for the following reasons and personally don't recommend this method because:
1) You cannot run another script until you end the current one (a problem for someone who uses scripts very often).
2) Its not exactly endless because escape key will end it (unfortunately, i use escape a lot).
3) Most importantly the WHILE loop is always running. So even when XYplorer is idle, the process XYplorer.exe in task manager will show constant CPU usage (atleast for me it was about 10%) which will keep jumping up and down until you end this script. Normal CPU usage without the script running is mostly 0%.
I don't mean to patronize, just letting you (and others) know some downsides of this.
Happy scripting.
binocular222 wrote:1) I can load other scripts at the same time (either via Scripting > Load selected script file or via shortcut keys), don't know why not work for you.
binocular222 wrote: 2) Yes, Esc will end it, fortunately, I only press Esc when renaming file (the script is not terminated then)
binocular222 wrote: 3) Yes, there's a trade off between speed and CPU load. wait=10 means super fast folder navigation with high CPU load. Wait=100 maybe more reasonable.
Code: Select all
elseif(strpos(get("drives", 2), substr($path, 0, 2)) >-1) { Tab("rename", "<curfolder>|<xypath>\icon\USB.ico"); }
elseif(strpos(get("drives", 4), substr($path, 0, 2)) >-1) { Tab("rename", "<curfolder>|<xypath>\icon\Network drive.ico"); }
elseif(strpos(get("drives", 5), substr($path, 0, 2)) >-1) { Tab("rename", "<curfolder>|<xypath>\icon\CD-ROM.ico"); }