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?
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