PreviewFolder - Get a peek preview for folder contents
PreviewFolder - Get a peek preview for folder contents
Probably the best way to handle it is to assign this script a keyboard shortcut (although it does work on a CTB as well)...
What it does?
You select a folder and hit the shortcut that you've assigned to this script and you get: Depending on the $mode variable's content you step into the parent folder of the clicked item
and select the item ($mode = 0), jump directly in a clicked folder ($mode = 1) or move the
clicked item into the selected folder in the inactive pane (or when no folder is selected,
in the current path of the inactive pane) ($mode = 2).
The current mode is displayed in the stats line at the top of the menu (Select, Go into, Move)...
Pros:
Works without any additional tools
Shows icons flawlessly
Current version: Old version(s): Old version download count: 365
What it does?
You select a folder and hit the shortcut that you've assigned to this script and you get: Depending on the $mode variable's content you step into the parent folder of the clicked item
and select the item ($mode = 0), jump directly in a clicked folder ($mode = 1) or move the
clicked item into the selected folder in the inactive pane (or when no folder is selected,
in the current path of the inactive pane) ($mode = 2).
The current mode is displayed in the stats line at the top of the menu (Select, Go into, Move)...
Pros:
Works without any additional tools
Shows icons flawlessly
Current version: Old version(s): Old version download count: 365
One of my scripts helped you out? Please donate via Paypal
Re: PreviewFolder - Get a peek preview for folder contents
With large folders it takes a really long time to process, naturally.
The problem is I cannot cancel the script in such instances when nothing seems to happen for a while. I either have to kill XY or wait
EDIT:
Is there a (scripting) way to automatically execute #1062 upon selection change, if the focused item is a folder?
The problem is I cannot cancel the script in such instances when nothing seems to happen for a while. I either have to kill XY or wait
EDIT:
Is there a (scripting) way to automatically execute #1062 upon selection change, if the focused item is a folder?
Re: PreviewFolder - Get a peek preview for folder contents
The question is, which part of it takes so long?
The listfolder / foldersize commands?
Adding the icons for each entry?
Writing the temp file?
Let's start with listfolder / foldersize:
Create a .xys file in that folder that takes so long, paste this script into it and execute it afterwards.
If you get execution times < 1000 (msecs), raise the loop value!
Post results...
The listfolder / foldersize commands?
Adding the icons for each entry?
Writing the temp file?
Let's start with listfolder / foldersize:
Code: Select all
$loops = 5;
$i = 0;
$execTimeLF = 0;
$execTimeFS = 0;
while ($i < $loops) {
$startLF = now("msecs");
$items = listfolder("<curpath>", , 4, $lb);
$durationLF = now("msecs") - $startLF;
$execTimeLF = $execTimeLF + $durationLF;
$startFS = now("msecs");
$items = listfolder("<curpath>", , 4, $lb);
$durationFS = now("msecs") - $startFS;
$execTimeFS = $execTimeFS + $durationFS;
$i++;
}
$listfolder = "Processed: Listfolder<crlf>Loops: $loops<crlf>Exectime: $execTimeLF msecs";
$folderSize = "Processed: Foldersize<crlf>Loops: $loops<crlf>Exectime: $execTimeFS msecs";
text "$listfolder<crlf 3>$folderSize";
If you get execution times < 1000 (msecs), raise the loop value!
Post results...
There is no way to do anything scripting wise from inside XY when anything like that happens.EDIT:
Is there a (scripting) way to automatically execute #1062 upon selection change, if the focused item is a folder?
One of my scripts helped you out? Please donate via Paypal
Re: PreviewFolder - Get a peek preview for folder contents
Exectime: 514 msecs - no problem so far.
Thanks for the answer to focus-change. A pity that XY cannot be made to act on it. I was already getting all revved up on my plans to preview folder content without additional trigger keys.
Thanks for the answer to focus-change. A pity that XY cannot be made to act on it. I was already getting all revved up on my plans to preview folder content without additional trigger keys.
Re: PreviewFolder - Get a peek preview for folder contents
Another thing I noticed: The sluggishness it not linear. When you preview, say, Windows System32 with roughly 4000 files in it, it takes around 20secs, an old photoshop archive with 8000 files doesn't take twice as long but almost a minute. Not sure if the content itself makes a difference.
No time for further testing, something else came up
Later....
Stef
No time for further testing, something else came up
Later....
Stef
Re: PreviewFolder - Get a peek preview for folder contents
Shouldn't matter...
New version up, should be between 10 and a 100 times faster than v0.1...
foreach loops are evil, regexmatches / regexreplace rules...
New version up, should be between 10 and a 100 times faster than v0.1...
foreach loops are evil, regexmatches / regexreplace rules...
One of my scripts helped you out? Please donate via Paypal
Re: PreviewFolder - Get a peek preview for folder contents
If( highend and Regex == "1") { } Yeah I know bad syntax.
Why not make the script work on <curpath> when the folder is not selected in the list pane. So if I have a folder in the tree selected or focused, it will use that that a folder. After all, it is a folder peak script so you'd kind of expect it to work on a folder selected via the tree if the user doesn't have a folder selected in the list pane.Thanks,
Ken
Why not make the script work on <curpath> when the folder is not selected in the list pane. So if I have a folder in the tree selected or focused, it will use that that a folder. After all, it is a folder peak script so you'd kind of expect it to work on a folder selected via the tree if the user doesn't have a folder selected in the list pane.
Code: Select all
if(("<curitem>" != "") AND (exists("<curitem>") != "1")) {$cur_folder = "<curitem>";} else {$cur_folder = "<curpath>";}
Ken
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
Re: PreviewFolder - Get a peek preview for folder contents
I don't understand...
Regardless of which folder you select in the tree, it's content is displayed in the list pane, right?
Why should I display a preview of the folder I'm currently in? There must be something that I'm missing... *shrug*
Regardless of which folder you select in the tree, it's content is displayed in the list pane, right?
Why should I display a preview of the folder I'm currently in? There must be something that I'm missing... *shrug*
One of my scripts helped you out? Please donate via Paypal
Re: PreviewFolder - Get a peek preview for folder contents
No you're not missing anything. Sorry and excuse me, I must have been having an old age moment.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
Re: PreviewFolder - Get a peek preview for folder contents
You solved the delay problem, now it's fast enough to be used on large folders as well.
What I liked better before was the immediate access to subfolders, simply by clicking on them. Whereas the new version only highlights the subfolder. Any chance to customize that behavior?
What I liked better before was the immediate access to subfolders, simply by clicking on them. Whereas the new version only highlights the subfolder. Any chance to customize that behavior?
Re: PreviewFolder - Get a peek preview for folder contents
v0.3 has the variable: $stepIntoFolders = 0;Any chance to customize that behavior?
0 = only select the folder
1 = step into it instead
One of my scripts helped you out? Please donate via Paypal
Re: PreviewFolder - Get a peek preview for folder contents
Very nice. Thanks.
One more thing came up: Files and folders staring with an underscore_ don't get listed.
One more thing came up: Files and folders staring with an underscore_ don't get listed.
Re: PreviewFolder - Get a peek preview for folder contents
Yeah, that's because the underscore as the first char for a subscript stands for a hidden one.
I have a solution in place but I don't know if it'll work on every system...
If you want to try it, do the following:
Replace that part with this one:
Does that still work, is the file still shown with just a single leading underscore?
Ofc I know that this is necessary for folders as well...
I have a solution in place but I don't know if it'll work on every system...
If you want to try it, do the following:
Code: Select all
// Only add entries if there really are files or folders!
if ($files) {
$files = regexreplace($files, "^(.*?$)(\r?\n|$)", "$q$1|<curitem>\$1$q goto $q<curitem>\$1$q;$lb");
}
Code: Select all
// Only add entries if there really are files or folders!
if ($files) {
$files = regexreplace($files, "^(.*?$)(\r?\n|$)", "$q$1|<curitem>\$1$q goto $q<curitem>\$1$q;$lb");
// Replace an underscore (otherwise it would be a hidden script)
$files = regexreplace($files, "^(.)_", "$1" . chr(31) . "__");
}
Ofc I know that this is necessary for folders as well...
One of my scripts helped you out? Please donate via Paypal
Re: PreviewFolder - Get a peek preview for folder contents
Yep, that did the trick. At least for the machine under my fingers right now. Do you mean to say it might not work for other operating systems? Or for other directory environments?
Could you do the same for folders?
Could you do the same for folders?
I remember reading about it, somewhere in a XY beginners' tutorial. A very unfortunate choice of char if it causes interference with files and folders. The underscore is a common prefix imo, to make files float up to the top for quick access.highend wrote:that's because the underscore as the first char for a subscript stands for a hidden one.
Re: PreviewFolder - Get a peek preview for folder contents
It would be more of a font issue. Don't know if all fonts on all Windows version (& languages) have the exact same set of ascii chars. Ofc they should but I didn't test that...
v0.4 is online, it should fix the underscore "issue" for all files & folders.
v0.4 is online, it should fix the underscore "issue" for all files & folders.
One of my scripts helped you out? Please donate via Paypal