Page 1 of 2

How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 06 Jun 2021 07:47
by respect
I have a pretty long list of folders, subfolders and sub-sub folders. In these last folders are pictures.
I want the folders and subfolders and sub-subfolders to remain set in Details view mode and all the pictures in view mode Large Icons.

It looks I failed to properly use Folder View Settings because the folders are also set in Large Icon mode.

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 06 Jun 2021 08:19
by highend
Do you mean that e.g.

Code: Select all

folder1
  subfolder2
      sub-subfolder3
      image1
      image2
and you're viewing the content of subfolder2 in a list pane that not only image1 and image2 are shown in large icon mode but ALSO sub-subfolder3?

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 06 Jun 2021 14:24
by klownboy
Hey highend I hope all is well. Respect should clarify, but I think based on "In these last folders are pictures", he means the images are the contained within sub-subfolders. So you'd see the images in Large Icon mode in the list pane when the sub-subfolder is selected in the tree.

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 06 Jun 2021 16:16
by highend
Hi Ken,
everything's fine here, I hope on your side as well...

If that's the case and if these folders don't follow a specific pattern (like "*\Image_* = Image_1, Image_2, Image_xyz) this can be done by either setting a folder view setting for each of these sub-subdirs by applying one template to all of them (not really recommended^^) or by using a custom event action like (using a script for: Changing Locations - After painting the file list):

Code: Select all

    $path   = "R:\root\sub";
    $parent = gettoken(<newpath>, -2, "\", , 1);
    if (strpos($parent, $path) != -1) {
        if (get("view") != 7) { #309; } // Large icon view
    } else {
        if (get("view") != 0) { #302; } // Details view
    }
Where you define the path where the sub-subfolders are in in $path

and the script does the view switching...

Ofc this is only the simplest form of it. I'd recommend to add testing how many images are inside a folder as well...

Or alternatively as a more general approach (regardless of folder structure, but by looking on which percent scale of files inside a folder are images):

Code: Select all

    $files     = listfolder(<newpath>, , 1, <crlf>);
    $cntFiles  = gettoken($files, "count", <crlf>);
    $images    = quicksearch("{:Image}", $files);
    $cntImages = gettoken($images, "count", <crlf>);
    if ($cntFiles) {
        $percent = $cntImages / $cntFiles;

        if ($percent >= 0.75) {
            if (get("view") != 7) { #309; } // Large icon view
        } else {
            if (get("view") != 0) { #302; } // Details view
        }
    }

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 06 Jun 2021 17:24
by klownboy
Hi highend, all is well here. After seeing your scripts, I was curious if you could do something using XY's built-in FVS controls though I like your script idea for a view based on content (e.g., images vs folders).

I set a folder view for main "folder" for detail view and "include subs" in the FVS check list,
Make another FVS setting for the subs of "subfolder" (defined as "F:\folder\*\*" in Large Icon view (which will take precedence over the "folder" FVS), I get what I'm thinking respect wants...and it will apply to any names given to the subfolders or any names given to sub-subfolders.

Click on folder in tree -> detail view of "subfolders"
click on subfolder in tree -> detail view of "sub-subfolders"
click on sub-subfolders -> Large Icon view of the images under sub-subfolders

Respect, are you sure you want Large Icon view? That simply shows the same image program's default icon for all images. Wouldn't you want the small thumbnail view to actually show the images in a thumbnail?

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 06 Jun 2021 17:51
by highend
That may work but whenever this kind of hierarchy changes you have to adapt your folder view settings. That's why I posted a general approach above as well. It just depends on what you see regardless where you are. Less thinking and less setup to do...

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 06 Jun 2021 18:18
by notabot
Another approach:

Explorer will mark folders that contain pictures as such (in it's out of the box configuration). [1]
After that, it is just checking that folder's Desktop.ini and see if it contains

Code: Select all

[ViewState]
FolderType=Pictures
Even less to worry about :)



[1] That can be changed manually too: press ALT+ENTER on a foldername, go to the Customize tab and select Pictures

2021-06-06 18_13_11-Window.png
2021-06-06 18_13_11-Window.png (12.81 KiB) Viewed 2501 times

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 06 Jun 2021 18:41
by highend
Explorer will mark folders that contain pictures as such (in it's out of the box configuration)
Not here. 20H2, with no configuration change at all (fresh install in a VM).
Copying 3 .png files into e.g. "C:\Temp" doesn't create a desktop.ini in it (even after navigating out and in again)

And even if it would do so (apart that you would need to visit it with Windows Explorer first), does Windows "unconfigure" (aka delete the desktop.ini or change FolderType to general items?) if you move all images out of that folder again?

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 08 Jun 2021 16:11
by respect
klownboy wrote: 06 Jun 2021 17:24 Hi highend, all is well here. After seeing your scripts, I was curious if you could do something using XY's built-in FVS controls though I like your script idea for a view based on content (e.g., images vs folders).

I set a folder view for main "folder" for detail view and "include subs" in the FVS check list,
Make another FVS setting for the subs of "subfolder" (defined as "F:\folder\*\*" in Large Icon view (which will take precedence over the "folder" FVS), I get what I'm thinking respect wants...and it will apply to any names given to the subfolders or any names given to sub-subfolders.

Click on folder in tree -> detail view of "subfolders"
click on subfolder in tree -> detail view of "sub-subfolders"
click on sub-subfolders -> Large Icon view of the images under sub-subfolders

Respect, are you sure you want Large Icon view? That simply shows the same image program's default icon for all images. Wouldn't you want the small thumbnail view to actually show the images in a thumbnail?
Yes, this is indeed what I mean. I just don't get the contents of all the image files in icon view mode (I opted for the smaller icon view). The image files from the 2nd, 3rd folder, etc. remains in Details view mode. I saved the folder view settings in the first sub-sub folder as leading view mode.
Then I applied C:\Users\Henk\Desktop\*\*\ in the FVS. I did check in the other sub-sub folders and the images are still listed in Details view mode, they are not changed in icon view mode.

Thank you for helping me out.

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 08 Jun 2021 17:36
by klownboy
respect wrote: 08 Jun 2021 16:11 I just don't get the contents of all the image files in icon view mode (I opted for the smaller icon view).
From my testing I don't believe you're suppose to get a view of the actual image when your in a small icon view. Even in MS Explorer, you don't see an actual file image until you size up to a large or extra large view. So in XYplorer you have to go to a small #1 size thumbnail view to get an actual view of the file image in a small thumbnail. You can think of XY's 3 thumbnail views as similar to MS Explorer's Large and Extra Large Icon views.

Make sure you are situated in the folder you'd like to change/update the FVS, change to the view desired and then save your FVS. I find that menu item View > Folder View Settings > Manage Folder views... is usually the best option to tweak your FVSs especially after initially applying them. You can then choose your options like include subfolders etc.

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 09 Jun 2021 00:02
by notabot
highend wrote: 06 Jun 2021 18:41
Explorer will mark folders that contain pictures as such (in it's out of the box configuration)
Not here. 20H2, with no configuration change at all (fresh install in a VM).
Copying 3 .png files into e.g. "C:\Temp" doesn't create a desktop.ini in it (even after navigating out and in again)
OK, so that is a Windows front end change or the better (finally! :))
I have to say that it was quite some time ago that I tested this. It was rather inconvenient as folders got 'flagged' after the first files, so if uou first put some cover pictures in it, it got labeled 'Pictures', even when that was followed by many mp3's. You had to keep the order in mind.

Can't test it now as I configured all (new) folders to be of the 'general' type and I have no intention to open that can of worms again.


The advantage of using this mechanism is that it survives renaming/copying/moving the folder and has a simple universal way (through ALT+ENTER) to flag the folders to the type you want.

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 15 Jan 2022 11:59
by Mosed
highend wrote: 06 Jun 2021 16:16 Or alternatively as a more general approach (regardless of folder structure, but by looking on which percent scale of files inside a folder are images):

Code: Select all

    $files     = listfolder(<newpath>, , 1, <crlf>);
    $cntFiles  = gettoken($files, "count", <crlf>);
    $images    = quicksearch("{:Image}", $files);
    $cntImages = gettoken($images, "count", <crlf>);
    if ($cntFiles) {
        $percent = $cntImages / $cntFiles;

        if ($percent >= 0.75) {
            if (get("view") != 7) { #309; } // Large icon view
        } else {
            if (get("view") != 0) { #302; } // Details view
        }
    }
    
Hi,

I tried this script for "after painting the file list" with "large tiles view" for images, but there are two issues:
1. The script searches also in the subfolders, but not only in the actual folder. So also a root is set to "image view" when a subfolder contains images - can this be changed?
2. the view with images is set to "large icons" instead of "large tiles". Is "large tiles view" not the correct variable?

Another question: What does this area of the script mean? "if (get("view") != 7" and "if (get("view") != 0"? For what does the digits stand for? I thought the script is searching for images and if there are more then 75 % images in the folders the view setting is changed.

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 15 Jan 2022 12:14
by highend
1. The script searches also in the subfolders, but not only in the actual folder. So also a root is set to "image view" when a subfolder contains images - can this be changed?
quicksearch() supports switches, one of them is not to dive into subfolders. Set it
2. the view with images is set to "large icons" instead of "large tiles". Is "large tiles view" not the correct variable?
What variable?

Large tile view command is #314;
But if you use this, check the view mode "digits", because you'd need a different one then.
For what does the digits stand for?
For the current view mode. It doesn't make sense to execute a command id if that view mode is already active.

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 15 Jan 2022 16:34
by Mosed
highend wrote: 15 Jan 2022 12:14
1. The script searches also in the subfolders, but not only in the actual folder. So also a root is set to "image view" when a subfolder contains images - can this be changed?
quicksearch() supports switches, one of them is not to dive into subfolders. Set it
ok, do you mean flags? I see in the help only some flags, but nothing related to not use subfolders. Where do I find an overwiew about all possible flags/switches?
In general it is quite difficult to find the needed information in the help.

2. the view with images is set to "large icons" instead of "large tiles". Is "large tiles view" not the correct variable?
What variable?

Large tile view command is #314;
But if you use this, check the view mode "digits", because you'd need a different one then.
For what does the digits stand for?
For the current view mode. It doesn't make sense to execute a command id if that view mode is already active.
Ah, now I see it. It is only a description behind //. Not the variable.

So this part must be:

Code: Select all

        if ($percent >= 0.75) {
            if (get("view") != 9) { #314; } // Large tiles view
        } else {
            if (get("view") != 0) { #302; } // Details view
        }

Re: How to set folder and subfolders in Details mode while contents in Icon mode

Posted: 15 Jan 2022 16:38
by highend
Address bar: rtfm "idh_quicknamesearch.htm";
So this part must be
Correct