New Get("FVS")
New Get("FVS")
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
Re: New Get("FVS")
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...
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
-
- Site Admin
- Posts: 60288
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: New Get("FVS")
Looks possible but is not a quick thing to do for me. Maybe later...
FAQ | XY News RSS | XY Twitter
Re: New Get("FVS")
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
-
- Site Admin
- Posts: 60288
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: New Get("FVS")
Next version:
Don't have the time to document this officially...
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
FAQ | XY News RSS | XY Twitter
Re: New Get("FVS")
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.
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
Re: New Get("FVS")
At 14:31
At 15:35admin wrote:Looks possible but is not a quick thing to do for me. Maybe later...
"Maybe later" := 64 minutes =>admin wrote:Done
Re: New Get("FVS")
Yeah, isn't he something!Filehero wrote:"Maybe later" := 64 minutes =>
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440
-
- Site Admin
- Posts: 60288
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: New Get("FVS")
Yep, correct bug analysis with that "default" FVS. Fix comes next...
FAQ | XY News RSS | XY Twitter
Re: New Get("FVS")
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.admin wrote:correct bug analysis with that "default" FVS. Fix comes next...
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440
-
- Site Admin
- Posts: 60288
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: New Get("FVS")
This was just quickly done. Can be made more thoroughly later...
FAQ | XY News RSS | XY Twitter
Re: New Get("FVS")
Thanks Don. It does everything I need it to do.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440
Re: New Get("FVS")
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.klownboy wrote:Thanks Don. It does everything I need it to do.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440
-
- Site Admin
- Posts: 60288
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: New Get("FVS")
AFAIK saving an FVS is only possible in Browse mode, so there is not need to retrieve the mode. It's always Browse.
FAQ | XY News RSS | XY Twitter
Re: New Get("FVS")
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?
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440