CloseAllTabs

Title CloseAllTabs
File Name CloseAllTabs.txt
Description Close all tabs (even locked) in the current panel
Author Vochomurka
Parameters -
Plugins Called win, tc, childwin, ini
Icon
Version 2.0
Updated on 08.06.2009
local hwnd = win.handle("c=TTOTAL_CMD")
win.sendmessage(hwnd, 0x400+51, 3008, 0)
;Sub_TMTC - name of script TMTC 
if(not runfile.Subs\Sub_TMTC(hwnd))
	quit

;OpenTabs - name of script OpenTabs 
runfile.OpenTabs("No.tab", 0)
win.sendmessage(hwnd, 0x400+51, 3008, 0)
if(not runfile.Subs\Sub_TMTC(hwnd))
	quit

Comments:

Attention! This script does not work in Total Commander 7.5 pb1 and pb2!

This script for Total Commander 7.0 and older.

How to close all tabs and get the "tabless" panel, as in Total Commander older than version 6.0?

It seems that there are two ways. First way is the cm_CloseAllTabs command. But it can't close locked tabs. I consider this feature as a bad one. It would be better to include the following choices in the configuration:
Reaction to "Close All Tabs" command:
Close all
Close unlocked only
Prompt for each locked
If I lack some feature in Total Commander, I prefer writing a script rather than a "wish" in the Total Commander forum. There is no hope that Mr. Ghisler would implement the requested function in the next release. I don't like to wait in vain for people doing something for me, especially if I am capable of doing it myself... Sorry for this digression...

The second way to close all tabs is better than the first one. I have created the following No.tab file:

[activetabs]
0_path=
0_options=
activetab=0

So as to close all tabs the opentabs No.tab command should be executed. This way has at least two disadvantages. First: the opentabs command can't be assigned to a button on bar called with both TCmenu and TCToolbar programs. By the same reason it can't be executed externally by PowerPro. It can be assigned to a hotkey, neither... Well, I understand the cause: unlike other commands, this one requires a parameter...

Second disadvantage is the following. Even if the checkbox "Show tab header also when there is only one tab" is unchecked, the panel looks woefully, and after executing the cm_RereadSource command it contradicts the settings.

The present script is disposed of all the said drawbacks.


All Scripts Total Commander TotalCmd.net PowerPro