New Get("FVS")

Features wanted...
klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

New Get("FVS")

Post by klownboy »

Hi Don, I asked over in Q & A whether it was possible to determine if a folder has a FVS established. I'd like to be able to determine in a script if a specified folder or current folder has pre-established Folder View Settings (FVS), and if possible, if it includes the sub folders option. There's really no direct way to do this in scripting since FVS.dat is a binary file. CID #477 lists the FVS folders but that difficult to relate in scripting. Would it be possible to have a new get("fvs") that would take a folder for input or if not included the current folder. I would think that all it would need to return is "1" or "0" if a FVS is set, and if possible return a "1" or "0" if the FVS for that folder included sub folders or some combination for the two settings. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: New Get("FVS")

Post by highend »

A binary combined value would probably be a viable option...
Would allow to return a lot more flags if necessary

0 = No fvs
1 = fvs set
2 = Include subfolders
4 = Match case
8 = View mode
16 = Sort order
32 = Column layout
64 = List style
128 = Auto-save changes

So, it returns 7 if fvs is set and include subfolders + match case are enabled...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

admin
Site Admin
Posts: 60288
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: New Get("FVS")

Post by admin »

Looks possible but is not a quick thing to do for me. Maybe later...

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

Re: New Get("FVS")

Post by klownboy »

Thanks Don. I'd be happy, at least initially, with the first 3 returns values: FVS set or not, and includes sub folders.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

admin
Site Admin
Posts: 60288
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: New Get("FVS")

Post by admin »

Next version:

Code: Select all

      ' Syntax: get("fvs", folder)
      ' eg: echo get("fvs", "C:\Users\Donald\Desktop\Desk");
      '     echo get("fvs", "Desktop\Desk");
      ' return bit field: 1 = has FVS, 2 = Include subfolders, 4 = Match case
Don't have the time to document this officially...

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

Re: New Get("FVS")

Post by klownboy »

Thank you very much Don. Question though, I'm getting a return of "1" on every folder unless it's a folder that I have a Folder View set with "including sub-folders" (as expected returns "3"). Is that due to the fact that all the other folders will get a "1" return since they are covered by the "default" FVS? Is that expected? Would there be any way to take the "default" out of the picture, like it would get a "0" return. Right now it looks like you'd always get a "1" return and never get a "0" unless you deleted a default view. FYI, I don't use Match case - it's not checked on any of them.

Edit 1: I ask the above because I would say that the <default> FVS, though in the true sense of the word is a FVS, it's not really a specific FVS. It just covers everything else that doesn't have a specific assigned.

Edit 2: I deleted my default to see the results and yes, now I get a "0" return for any folders which do not have a specific FVS. But, I suppose that makes a "1" return a bit unreliable as far as a check in scripting for a FVS among various users unless the user has a "including sub folders" checked as well...which I do typically. I will probably just do checks for a "3" return since that's most common for images.
Last edited by klownboy on 22 Mar 2018 20:13, edited 1 time in total.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: New Get("FVS")

Post by Filehero »

At 14:31
admin wrote:Looks possible but is not a quick thing to do for me. Maybe later...
At 15:35
admin wrote:Done
"Maybe later" := 64 minutes => :beer:

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

Re: New Get("FVS")

Post by klownboy »

Filehero wrote:"Maybe later" := 64 minutes =>
Yeah, isn't he something! :beer:
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

admin
Site Admin
Posts: 60288
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: New Get("FVS")

Post by admin »

Yep, correct bug analysis with that "default" FVS. Fix comes next...

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

Re: New Get("FVS")

Post by klownboy »

admin wrote:correct bug analysis with that "default" FVS. Fix comes next...
I don't know that I'd call it a bug. Wasn't the <default> FVS simply being treated like any other FVS? Which isn't what we wanted but Get("fvs","folderpath") is working as expected now. It doesn't seem to take a current path as a default if a folder is not provided though I'm not sure if you coded that. I don't care myself Don since I'll be specifying a folder anyway. I just figured I'd mention it. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

admin
Site Admin
Posts: 60288
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: New Get("FVS")

Post by admin »

This was just quickly done. Can be made more thoroughly later...

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

Re: New Get("FVS")

Post by klownboy »

Thanks Don. It does everything I need it to do. :tup:
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

Re: New Get("FVS")

Post by klownboy »

klownboy wrote:Thanks Don. It does everything I need it to do.
Hi Don, an unexpected followup...I probably spoke to soon above. Is there any way that you could return what the saved view mode is in the FVS? Of course it's possible that the FVS may not have a saved view mode if view mode wasn't checked. I initially thought I might get away without it. I can make some assumptions, but I'm running into situations where a user could have a folder with a FVS view mode that is not the current view mode and/or the user may be building thumbs in a view different from a FVS. To make things worse, the thumb size in the cache, probably is, but may not necessarily be the thumbsize of the saved FVS. I don't know if that would be possible. The return could possibly be in the same as the SC get("view")return. Thanks.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

admin
Site Admin
Posts: 60288
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: New Get("FVS")

Post by admin »

AFAIK saving an FVS is only possible in Browse mode, so there is not need to retrieve the mode. It's always Browse.

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

Re: New Get("FVS")

Post by klownboy »

In looking at it again my post was probably confusing, but the "mode" I was after is the "View mode (details,thumbnails...)" under "Applied Setting" in the "Edit Folder View" dialog box for "Folder View Setting". Wouldn't that view mode have to be saved for a particular folder in FVS.dat provided the checkbox is ticked?
Edit FVS_Capture.JPG
Edit FVS_Capture.JPG (27.5 KiB) Viewed 1167 times
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Post Reply