Save Quick Search

I use the quick search field on the top right a lot. Is there a way to save the text you type there and put it in a button?

I want a button that when I press, do a quick search of folder.jpg for example. It should quick search the current and sub folders as quick search does.

I need a little more help than it's possible, few lines of the commands please.

The command for that is Find QUERY, so for example Find QUERY filename:folder.jpg.

1 Like

Thank you so much. That was so easy.

And what to do to clear the search?

These does not work:
Find CLEAR
Find QUERY CLEAR

If you mean you want to clear the text from the search field (top right of the toolbar), I think that should happen automatically when you navigate away from the search results.

No, it is persistent until you click the little x in the field. I want to clear the text so the results in the window are also cleared back to before the quick search. I want to do that with a button and not to click on the x.

If you can still see the list of results you can't have navigated to another folder yet, unless I'm misunderstanding.

Go UP will go back to the main folder, like clicking the parent button, but there are already toolbar buttons and hotkeys for that.

1 Like

Thank you. That's it. Go UP does the same thing.

Now how can I put these 2 commands

Find QUERY filename:folder.jpg
and
Go UP

in one button? A two state button. When the button is down
Find QUERY filename:folder.jpg
when it is up
Go UP

By the way, by persistent I meant if you click on another tab, you don't lose the quick search in the original tab.

Try this:

@ifpath:coll://*%%Lister-Quick-Find-Results%%*
Go UP
@ifpath:else
Find QUERY filename:folder.jpg
1 Like

Thank you. I'm amazed how Opus can make life easy.

I have spent half an hour trying to include icons for the two states and I can't.

Imagine I want 2 icons for the 2 states.
@icon:icon1 and @icon:icon2. Where should I put those? Not working under @ifpath

If you click the @icon line in the button editor, it should open an icon selector.

No I mean what should I write so it can detect the 2 states? what commands should I write. For example this also doesn't work. I know I have to put a condition after each icon.

@icon:show,@ifpath:coll://%%Lister-Quick-Find-Results%%
@icon:read,@ifpath:else

I just spent 6 hours and was not able to find a solution. Now I have come to the conclusion of instead of changing the icons, I better use toggle instead. So I have to write

@toggle:if

the condition as Leo wrote would be
@ifpath:coll://%%Lister-Quick-Find-Results%%

But still I'm unable. How to say check if the path is
coll://%%Lister-Quick-Find-Results%% after @toggle: ?

There isn't a (good) way to change a button's appearance based on the current path.

(Other than to completely hide or disable the button, which wouldn't make sense here. Unless you had two separate buttons with different looks and swapped between the two, which would work. @hideifpath can do that.)

If the issue is that you want a clear way to tell when you're looking at search results rather than a normal folder, setting a background color for search results might be a better method. If that sounds like what you want, you can do it via Preferences / Folders / Folder Formats:

Ok, what about making a variable and changing that variable to 0 and 1 each time you press the button? Then use that variable to see if it's 0 or 1 and toggle based on that?

You could do that, but then if you navigated via any other method the variable would be out of sync. Unless you wrote a script which reacted to folder change events and updated the variable. (But is this really worth that complexity? You can see you're in search results via the path field, the search field, and the background color if you wanted it. Does the button need to toggle as well?)

No it's not worth it. I will not do that but it would be more beautiful and correct.

This is something that the opus developers should consider.
If they have added the ability to use a line like this:

@ifpath:coll://*%%Lister-Quick-Find-Results%%*

You should be able to use the same tests in the button toggles and icons too.