Page 1 of 2
New Get("FVS")
Posted: 21 Mar 2018 23:41
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.
Re: New Get("FVS")
Posted: 21 Mar 2018 23:48
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...
Re: New Get("FVS")
Posted: 22 Mar 2018 14:31
by admin
Looks possible but is not a quick thing to do for me. Maybe later...
Re: New Get("FVS")
Posted: 22 Mar 2018 14:58
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.
Re: New Get("FVS")
Posted: 22 Mar 2018 15:35
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...
Re: New Get("FVS")
Posted: 22 Mar 2018 19:02
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.
Re: New Get("FVS")
Posted: 22 Mar 2018 20:08
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 =>

Re: New Get("FVS")
Posted: 22 Mar 2018 20:12
by klownboy
Filehero wrote:"Maybe later" := 64 minutes =>
Yeah, isn't he something!

Re: New Get("FVS")
Posted: 22 Mar 2018 20:46
by admin
Yep, correct bug analysis with that "default" FVS. Fix comes next...
Re: New Get("FVS")
Posted: 23 Mar 2018 13:14
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.
Re: New Get("FVS")
Posted: 23 Mar 2018 13:29
by admin
This was just quickly done. Can be made more thoroughly later...
Re: New Get("FVS")
Posted: 23 Mar 2018 14:59
by klownboy
Thanks Don. It does everything I need it to do.

Re: New Get("FVS")
Posted: 10 Apr 2018 19:12
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.
Re: New Get("FVS")
Posted: 11 Apr 2018 14:01
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.
Re: New Get("FVS")
Posted: 11 Apr 2018 14:39
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