Date modified toggle button

i am trying to make a button to toggle date modified ( to only show files / folders within the last day) click the same button and show all files / folders again
but need some help please

ive got this far (not shore if I'm on the right track)

set COLUMNS=modified

Are you aiming to toggle the column on and off, or to toggle which files are displayed/filtered?

toggle which files are displayed/filtered please

set SHOWFILTERFILENAME (may be)

reading this Searching and Filtering

While working in folders you will often encounter the situation where there are many more files displayed than the ones you actually want to work with. There are two main systems for reducing the number of files displayed to those you specifically want to target:

Filtering is used to hide files from the current display of a folder - for example, you might hide all files ending in .bak, or filter the display to only show image files. You can filter the list in two ways - with the quick filter using the Filter Bar, or with the various filter fields in the Folder Options system. There are also some global filtering options on the Folders / Folder Display Preferences page that you can use to always hide particular files.
Searching is used to locate files in and below the current folder - you might search for all MP3 files in the current folder or its sub-folders. The easiest way to search is with the indexed Windows Search system, although you can also use the Find Files function to perform more structured searches.

The main difference between filtering and searching is that filtering operates on the current list of files and removes files from the display, whereas searching starts from the current location and builds a new list of files that match the supplied criteria.

  1. Go to Preferences / File Operations / Filters and create a filter which matches the things you want to hide:

  2. Create a toolbar button or hotkey which runs this to hide the unwanted files and folders:

    Select FILTER PATTERN="Modified Before Today" DESELECTNOMATCH HIDESEL SHOWHIDDEN
    
  3. Create another which runs this to undo it and reveal the previously hidden files and folders:

    Select NOPATTERN SHOWHIDDEN
    

You could combine the two commands into a Three-Button so you left-click it for one action and right-click it for the other.

Making a single button toggle between the two states is possible, but more complicated as it needs a bit of scripting to keep track of which state is currently active.

Here's another variation in a regular button. The filtering is done via JS snippet inline. The current math filters the file display to only show items modified within the last hour, just multiply that "3600" by 24 to make it a day. The button also appears pressed-in / toggled as long as the filtering is active.

@toggle:if $src:HiddenItems

@ifset:$src:HiddenItems
@set src:HiddenItems
@set src:HiddenItems.bfc.drop
Select NOPATTERN SHOWHIDDEN 

@ifset:else
@set src:HiddenItems=1
@set src:HiddenItems.bfc.drop=always
SelectEx SIMILARMETAJS="if (((new Date().valueOf()-new Date(item.modify).valueOf())/1000)<3600) return true;" DESELECTNOMATCH
Select NOPATTERN HIDEUNSEL

You need SelectEx Command: SelectEx (extended Select command) and AutoVars Event: AutoVars (event-handling for variables) script addins for this button to work as expected.

Cool thank you both so much

the Dopus commands are very easy to understand when you see them written out like :
Select FILTER PATTERN="Modified Before Today" DESELECTNOMATCH HIDESEL SHOWHIDDEN ( just knowing what ones to use and in what order is my problem)
what i need is something like ..... lets get Dopus to do a task" enter name here :
then show how to do said task
i just need to see lots of them

is there any good place to start ?
reading Command Reference for now