Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - SKAN

Pages: [1]
1
Script / Re: Create empty text file
« on: June 20, 2013, 13:51:47 »
I use the following script to create a new text file in active explorer panel:
However, I have to press F2 manually to rename it.
MC.RunCmd ID=ExplorerPanel.51002 seems to execute before MC.CmdLineRun can complete!.
Is MC.CmdLineRun ASYNCHRONOUS?

Code: [Select]
@var $File = "New";
@var $Ext  = ".txt";
@var $Part = $File + $Ext;
@var $Full = GetSourcePath() + $File + $Ext;

@var $nStr;
@var $n = 1;

while( $n > 0 )
{

   // Break loop if target filename does not exist

   if( GetFileTime( $Full ) == 0 )
     {
       break;
     }

   // Otherwise increment filename and loop

   $nStr = numtostr($n);
   $Part = $File + " [" + $nStr + "]" + $Ext;
   $Full = GetSourcePath() + $Part;
   $n++;
}

MC.Explorer.Selection.UnselectAll;
MC.CmdLineRun CMD="cf {$Part}";

// MC.RunCmd ID=ExplorerPanel.51002

2
Script / Re: How to close all tabs?
« on: June 19, 2013, 06:04:31 »
Well, when I tried the following:

Code: [Select]
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.

3
Script / How to close all tabs?
« 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:

Code: [Select]
@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?

Pages: [1]