Clearing Search/Find Options

I have searched the forum and only discovered various bits of code that purportedly clear the search history and/or search options (date, contents, etc.) by deleting various files - only if executed prior to opening the search pane.

I have been unable to find a simple way to ensure that those options are reset each and every time I start a search. I can't remember ever needing to search for the same thing more than once but even if I did, the search history should be sufficient. On the other hand, it is extremely annoying to start a new search and realize only after that there was a date or some other option selected in the options from a previous search. It's almost enough to make me want to go back to PowerDesk (well, not really, but it is annoying). :wink:

Is there some configuration option that I'm overlooking that will prevent Directory Opus from retaining search options? Is there some other way to do this? Will this be a future configuration option?

TIA

You haven't missed anything. It's something we might tweak in the future (I'd like a quick way to reset the Find panel myself).

Yeah, it has much the same relevance as the "NOUPDATESETTINGS" arg we ended up gettign for the CreateFolder command...

Wait... are we all ~missing something?

While working on an updated command to get back to a 'detached / floating' find window, I just realized... doesn't the LOADPREV=no argument essentially clear all previous find options back to defaults??? So, rather than mess with deleting the find.osd file like some of us used to do, can't you just change your hotkeys, buttons etc to run Find LOADPREV=no to do this?

I have to admit, I didn't know/remember LOADPREV existed.

Here's a command that toggles the Find panel on and off, clearing the settings when it opens:

@ifset:UTILITY=Find,Toggle Set UTILITY=Off @ifset:else Set UTILITY=Off Find LOADPREV=no

I've replaced my Tools -> Find Panel menu item with that (which also replaces the Ctrl+F hotkey).

(Turning the utility panel off in both cases ensures that the Find panel is still cleared even if another utility panel was open at the time.)

(I've revised the command in my previous post a little.)

That's nice in that it's relatively simple and clears Name matching:, Containing text:, and probably other desirable things, but I don't like that it resets Show results in: source(new tab), so I'll stick with what I was using before.

Before anybody asks, what I was using before is

%Bat%\Directory_Opus_Clear_Find.ahk {alias|dopuslocaldata|noterm} Set UTILITY=Find,Toggle

See Clear the find fields before searching for more files for information about Directory_Opus_Clear_Find.ahk, the name of which I apparently changed.

While the find panel is normally accessible via the Set UTILITY=find command by default nowadays - you can still call the FIND function with any of the various arguments to fix up the find panel the way you want in addition to clearing any old settings...

So if you still want <Ctrl+F> to 'toggle' the find panel on and off, you could modify Leo's commands to run something like:

@ifset:UTILITY=Find,Toggle Set UTILITY=Off @ifset:else Set UTILITY=Off Find LOADPREV=no COLLNAME "Find Results" SHOWRESULTS=tab IN {s}
...to get what you want. This is the way I use it, and why I'm hoping we get Raw command support for 'Automatically shrink panel' added into the Find function options...

And actually, the COLLNAME "Find Results" part is probably not needed anymore as the Find Panel defaults to showing results in the find results collection... a holdover of mine from v9.

That does seem to work. Thanks.

Thanks everyone. I modified the function of the Find button with Leo's code and it seems to do what I was looking for.

Although

@ifset:UTILITY=Find,Toggle Set UTILITY=Off @ifset:else Set UTILITY=Off Find LOADPREV=no SHOWRESULTS=tab IN {s}
works, I have a couple of questions just for my understanding.

Looking at the documentation of @ifset it appears that @ifset some condition can be followed by multiple commands to be executed if the condition is true. If that's the case, why does the Find get executed in both cases.

Put another way, why isn't Find ... part of what is executed only for @ifset:else?

Regardless of the answer to that question, don't both cases result in Set UTILITY Off making the test pointless?

Doesn't simply

Set UTILITY=Off Find LOADPREV=no SHOWRESULTS=tab IN {s}
accomplish the same thing?

Find is not run in both cases.

The first case just turns off the panel.

The second case turns off the panel, then turns it back on again using the Find command, in a way that ensures it is reset to defaults (which won't work if the panel is already on; that is why it is turned off in the second case).

Yes, that's true, of course. I thought I had demonstrated otherwise, but I apparently somehow got confused in my experiments.