"findexisting" only acts in Source not in Destination

I am trying to delete the contents of a folder, and, if it is open in a tab, close the tab. I have this code in a Folder Tab context menu:

Delete F:\test*.* SHIFT FORCE QUIET RECYCLE
Go "F:\test" NEWTAB=findexisting,tofront
"C:\ProgramData\GPSoftware\Directory Opus\dopusrt.exe" /cmd Go TABCLOSE

The contents are always deleted.

If the open tab is in the source, it closes the open tab. If the open tab is in the destination, it does NOT close the open tab. It seems "findexisting" only looks at the source.

Any help, would be greatly appreciated.

Yes, because this is where Go will open the new tab.

Solution is this code:

GoExisting F:\test
Delete F:\test*.* ALL FORCE NORECYCLE QUIET
Go TABCLOSE

GoExisting is script available at:

You don’t need to open a tab at all, if the aim is just to close it.

You can use this to find and close any tabs matching a path or wildcard:

That’ll also work when there’s more than one tab to close.

Thank you for the script.

It is unworkable.

I used the code, as follows:

CloseAllTabs "path"
Delete F:\test\*.* ALL FORCE NORECYCLE QUIET

where path was:

CloseAllTabs "F:\test\*"
CloseAllTabs "F:\test\"
CloseAllTabs "F:\test"
CloseAllTabs "F:\test*.*"
CloseAllTabs "F:\test*"
CloseAllTabs "F:\*"
CloseAllTabs F:\
CloseAllTabs F:\*

It did not close an open tab of F:\test as a button in a toolbar or in the folder tabs context menu at all in the destination, or in the source unless in an open instance of the tab of F:\test. I used either the obs or vbs file in the "scripts addins" folder where it at all times showed it was enabled in Script Management. Several tabs were in each pane.

I'll stick with :

GoExisting F:\test
Go TABCLOSE
Delete F:\test\*.* ALL FORCE NORECYCLE QUIET

This works both as a button in a toolbar or in the folder tabs context menu. I need the first two lines of code if an open instance of the tab of F:\test exists.

Thank you.

CloseAllTabs "F:\Test\*" works here.

Here's what I do on my end.

This is a representative screenshot of my set up with five tabs in the two panes:

I right click on a tab and get:
Screen 23-10-28 10_01_28PM

I select Delete Contents of...

For the first three tabs left to right, test remains the last tab; it doesn't close. For the last two tabs, test closes and disappears.

For all five tabs, test closes using;
GoExisting F:\test
Delete F:\test*.* ALL FORCE NORECYCLE QUIET
Go TABCLOSE

That's not running CloseAllTabs at all?

Edit: Oh, I see, that's the command that works.

Can you show us the one that wasn't working before?

Also, let's check the CloseAllTabs command works on its own. Push > in the file display to open a command field, then paste this and push return:

CloseAllTabs "F:\Test\*"

image

That should close the specified tabs, and tells us if the script is working on its own. If it's not working inside a more complex command then there might be something else going on.

Using the representative screenshot from earlier in this thread, only tabs 4 and 5 from left to right closed the tab labelled test from the command line as requested. These were the same results as before.

Before, I used the code, as follows:

CloseAllTabs "path"
Delete F:\test\*.* ALL FORCE NORECYCLE QUIET
where path was:
CloseAllTabs "F:\test\*"
CloseAllTabs "F:\test\"
CloseAllTabs "F:\test"
CloseAllTabs "F:\test*.*"
CloseAllTabs "F:\test*"
CloseAllTabs "F:\*"
CloseAllTabs F:\
CloseAllTabs F:\*

It did not close an open tab of F:\test as a button in a toolbar or in the folder tabs context menu at all in the destination, or in the source unless in an open instance of the tab of F:\test. I used either the obs or vbs file in the "scripts addins" folder where it at all times showed it was enabled in Script Management. Several tabs were in each pane.

The files were always deleted under all tests.

I also disabled all 14 scripts from running except for CloseAllTabs and the results were the same.

I'm running Win10 22H2 19045.3570.

Thanks for your efforts!