Today Only Files/Folders Toggle Button

Hi all!

Is there a predefined button/menu to show today created files/folders only? By pressing it I want to see (not to select) today files/folders only. By unpressing it all the filters must return to the previous state in accordance with folder format.

I don't think there is. You'd need to create a filter.

1 Like

I made predefined filter todayfiles and added command to the button:

Set QUICKFILTER ?todayfiles

Works well! Thank you, Ixp!

2 Likes

Unfortunately this solution isn't universal enough, because Filter Bar's Evaluator must be enabled in Preferences by default. But Evaluator being turned on avoids quick type-and-find feature (Partial matching) of Filter Bar.

How can I modify button to use it with disabled Evaluator?

Try

Set QUICKFILTERFLAGS=evaloff QUICKFILTER ?todayfiles
1 Like

Tried. Same behavior. Works with enabled Evaluator only...

Use evalon if the filter needs the Evaluator to be on.

1 Like

Better, but Evaluator remains on after any button use. But my goal is to keep Evaluator off after button's work to able quick type-and-find Partial matching feature (doesn't work while Evaluator being enabled). Is it way to restore Evaluator off-status after pressing the button?

Such "script" doesn't work for me too:

Set QUICKFILTERFLAGS=evalon QUICKFILTER ?todayfiles
Set QUICKFILTERFLAGS=evaloff

Esc should do this.

1 Like

Nop... Esc just clears Filter field, but Evaluator remains on (even if disabled by default at preferences):

image

A script handling OnQuickFilterChange [Directory Opus Manual] could probably clear the flag when the filter itself is cleared.

1 Like

So I made the script:

option explicit

' Clear Evaluator Flag
' (c) 2024 Yourez

' This is a script for Directory Opus.
' See https://www.gpsoft.com.au/endpoints/redirect.php?page=scripts for development information.



' Called by Directory Opus to initialize the script
Function OnInit(initData)
	initData.name = "Clear Evaluator Flag"
	initData.version = "1.0"
	initData.copyright = "(c) 2024 Yourez"
'	initData.url = "https://resource.dopus.com/c/buttons-scripts/16"
	initData.desc = ""
	initData.default_enable = true
	initData.min_version = "13.0"


End Function

' Called when the quick filter is changed in a tab
Function OnQuickFilterChange(quickFilterChangeData)
DOpus.Create.Command.RunCommand("Set QUICKFILTERFLAGS=evaloff")
End Function

It works bad. After pressing my TodayOnly button lister shows today only files, but only for 0.5 sec, and then today files disappear at all. Meanwhile Evaluator flag turns off.

Your script turns off Evaluator mode on every filter change. That means it will turn it off even when you want it on. It should check what the filter is set to first to see if it should make the change or leave things alone.

1 Like

I turned to JS, it's more clear for me. Now it works. Guys, thanks a lot for help!

// Clear Evaluator Flag
// (c) 2024 Yourez

// This is a script for Directory Opus.
// See https://www.gpsoft.com.au/endpoints/redirect.php?page=scripts for development information.


// Called by Directory Opus to initialize the script
function OnInit(initData)
{
	initData.name = "Clear Evaluator Flag";
	initData.version = "1.0";
	initData.copyright = "(c) 2024 Yourez";
//	initData.url = "https://resource.dopus.com/c/buttons-scripts/16";
	initData.desc = "";
	initData.default_enable = true;
	initData.min_version = "13.0";
}

// Called when the quick filter is changed in a tab
function OnQuickFilterChange(quickFilterChangeData)
{
	var tab = quickFilterChangeData.tab;
	if (tab.quickfilter.filter == '') DOpus.Create.Command.RunCommand("Set QUICKFILTERFLAGS=evaloff");
}
1 Like