Multi Commander > Script

Create empty text file

<< < (2/2)

duci:
I wanted to post the same suggestion or question, where or how can I create an empty text file in MC. In my previous file manager it was possible with keys combination like SHIFT+F4 but here it doesn't work. This keys combination is very fast and useful. Do you plan to add something like that to next version of Multi Commander? The same is how to copy file into the same folder but with different file name. In my previous manager it was combination SHIFT+F5. These two options I used very often.

Thanks.

Dusan

Mathias (Author):
Shift+F5 (might be something other, depends on default style, men look in menu > file )
will copy the select file to the same folder and will suggest a name that is same as original with ".bak" appended

To create a empty file fast. You can type "cf <filname>" in the commandline field.

SKAN:
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: ---@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
--- End code ---

Jungle:
MC v3.2.0 supports creating new file (Shift+F4 by default) and it uses internal file associations.

Navigation

[0] Message Index

[*] Previous page

Go to full version