Multi Commander Support Forum
Multi Commander => Script => Topic started by: SKAN on June 18, 2013, 20:57:29
-
I use the following script to close all tabs in ( both panels ) and then open a couple of new explorers:
@var $n;
for( $n = 0; $n <= 20; $n++)
{
MC.RunCmd ID=core.20002; // Ctrl+W
}
MC.Explorer.NewBrowser SIDE=LEFT PATH="C:\";
MC.Explorer.NewBrowser SIDE=RIGHT PATH="D:\"
I feel uncomfortable with a limit of 20 tabs. Can anybody suggest a better way?
-
Maybe
MC.Explorer.CloseAll
However, It closes all Explorer Panel tabs, It will not close Search tabs.
-
Well, when I tried the following:
MC.Explorer.CloseAll;
MC.Explorer.NewBrowser SIDE=LEFT PATH="C:\";
MC.Explorer.NewBrowser SIDE=RIGHT PATH="D:\"
.. the new browsers appear and vanishes immediately. :(
I tried inserting a sleep( 5000) but it does not help.
-
Hmm too bad..
Think is is because CloseAll is sent as an async operation. and since the script is running in main thread it is not processed until script ends.
-
For the next version I will add
MC.CloseAllTabs
MC.CloseAllTabs LEFTONLY
MC.CloseAllTabs RIGHTONLY
And since it is under the core "MC" namespace it will close ALL of them. Even search tabs or other extensions, and It does not need to be handled async.