How to close a specific tab, if that tab is open

Hello. I have what is probably a simple issue but after quite a lot of time trying to figure it out, I cannot.

I have attached 4 screenshots, named "step1", "step2", "step3" and "step4" - each step is a picture of a sequence of actions I would like to take on a lister window. The first three steps are working fine, but the 4th step is not.

I have reconfigured the CTRL+F keystroke to not only open the ADVANCE FIND panel, but to also close the destination pane in my dual lister, and then to reopen that pane in the same path location when I toggle CTRL+F again. In other words, I want to be able to do a search using the full width of the lister window (therefore, I close the destination pane), but when I am finished by search, I want to reinstate my lister window to what it was before I opened the FIND panel. However, when I toggle to close the FIND panel, I also want to close the FIND RESULTS tab which has been created in the existing source pane - this is what I am unable to achieve.

Here is the code I am using for the CTRL+F keystroke:

Set UTILITY=Find,Toggle
Set DUAL=toggle,dest,right,remember

And this is working perfectly for me. However, I have tried to use "Go" with any of the variants of TABCLOSE so that IF the FIND RESULTS pane is open, it will close. In other words, I'm trying to do this:

Set UTILITY=Find,Toggle
Set DUAL=toggle,dest,right,remember

It is important that the GO TABCLOSE command does nothing if the FIND RESULTS collection pane is not existent, but to close it if it is existent. I can't seem to find a way to do that. I have specified the command with the argument "coll://Find Results", but this too does not seem to work. If I try to close the "current" tab, the behaviour is not right, even though it seems to me it should work because when I am ending the FIND session, the FIND RESULTS collection pane is the current tab. But that is not working either.

The screenshots attached are:

Step1: My original, starting lister.
Step2: What the lister looks like after CTRL+F, using my reconfigured keystroke.
Step3: What the lister looks like after I have done a search.
Step4: What the lister looks like after I close the FIND panel using the CTRL+F keystroke again.

As you can see, the FIND RESULTS is still open. What I want is for the FIND RESULTS to close. Everything else in the lister is exactly as I want it, except this.

Please help if you can. Thank you.


For simple conditional logic in non-script commands, you can use command modifiers like @ifpath. That will only work if the results tab is always active when you run the command and want to close it.

For a better solution, scripting is the way to go if you want complex conditional behaviour (e.g. look through all open tabs and close any that have a Find Results collection open).

Thanks for this. I don't have any scripting skills, particularly, so I don't want to go in that direction because of the time it will take me. Regarding @ifpath, you say that the tab should always be active when I run the command - by this I infer that since this is a toggle command, it won't work because when I first run the command, there is no FIND RESULTS tab at all - will the command fully fail or will it just act on that one clause in the 3-command set? If this could work because that tab does not have to be showing, but will close it when it is, can I ask you to please give me the exact syntax I need? I've tried everything I can think of and I just can't get it to work. Pretty please.

I don't want to disturb, but closing any find result tabs may be possible with that "CloseAllTabs" script command of yours, Leo?
I didn't try it with file collections, but it may be of help to you todd, without diving into scripting at all.
Find it here: Close all tabs matching a path wildcard

You can use @ifpath to run some commands only if the active path matches a wildcard, and run other commands all the time, so it should be able to do what you want. i.e. "If the current tab is showing Find Results, close it, otherwise don't close it".

I forgot I made that. Yes, you could use this to close any tab with the Find Results collection in it (whether or not it is the active tab):

CloseAllTabs PATH "coll://Find Results"

Just note that it will close the entire lister if it only has one tab and that tab is showing Find Results.

That works beautifully! Thank you very much, both of you.

Now, one last question: when saving the configuration of dopus, does this script get backed up as well, or must I save the osp file and reinstate it any time I need to reinstall the app?

Thanks a lot. Really great.

Config backups should include scripts.

great. thanks.