SaveTabs & LoadTabs

Title SaveTabs & LoadTabs
File Name SaveTabs.txt
OpenTabs.txt
Description Save and open tabs in the current panel
Author Vochomurka
Parameters -
Plugin called win
Icons
Version 1.0
Updated on 16.09.2005

Sometimes it happens that you temporarily need some specific tab set either stored in the *.tab file or created manually. But in this case the current tab set will be lost. To save it, you should do the following:

To prevent yourself from losing your time it's convenient to do it with one mouse click or one hotkey:
local hh = win.handle("c=TTOTAL_CMD")
win.postmessage(hh, 0x400+51, 3009, 0)
*keys {down 6}{enter}1^{enter}
if (validpath("path_to_tabs\1.tab"))
	*keys {right}{enter}
endif

Comments:

The path_to_tabs corresponds to the TabDir configuration key. Generally speaking, you could indicate another path or no path at all, but it's more reliable to do as prescribed by the configuration.

If file 1.tab exists, it will be rewritten, otherwise created.


In saving/loading tabs operations there is one more inadvertence. If there is no tabs in some panel and if the checkbox "Show tab header also when there is only one tab" is unchecked (I don't see any sense in the contrary. Do you?), there is no way to load a saved tab set there! The cm_DirTabsShowMenu command cannot be executed anyhow! The best (but not elegant) way is to open any tab (for example, by pressing Ctrl+T) and then invoke the tab menu by right-click.

However, suppose that there are some tabs in the current panel. To load saved tabs you should:

  1. Right-click on the tabs;
  2. Pick "Load tabs from file, replace tabs";
  3. Enter file name;
  4. Press "Open".

I use the script that does the same, but even there is no tabs in the panel:

if (validpath("path_to_tabs\1.tab")) do
	local hh = win.handle("c=TTOTAL_CMD")
	win.postmessage(hh, 0x400+51, 3001, 0)
	win.postmessage(hh, 0x400+51, 3009, 0)
	keys {up 4}{enter}1{down}^{enter}
	win.postmessage(hh, 0x400+51, 3007, 0)
endif

Comments:

If there is no 1.tab file, the script does nothing.


Main Page Total Commander PowerPro