Multi Commander Support Forum

Multi Commander => Feature Requests and Suggestions => Topic started by: alatar on July 14, 2011, 12:40:11

Title: New file shortcut...
Post by: alatar on July 14, 2011, 12:40:11
Like new folder but to create a file
Title: Re: New file shortcut...
Post by: Mathias (Author) on July 14, 2011, 15:05:01
There are some plans for creating file from template files and thinks like that.

But right new you can create an empty file with a commandline command.

if you write "cf <filename>" (cf stands for CreateFile) in the Command line field. An empty file with that name is create in the current location.

You can also create a User Command that are using Multi-Script, and there use the function SaveStringToFile(...) (and save an empty sting to a file for you want the file to be empty) and then assign that user command to shortcut and button or menu.

If you need any help drop a message.
Title: Re: New file shortcut...
Post by: wind.stt on July 28, 2011, 21:32:02
I tried to do that, and following Multi-Script worked already

@var $strFile = AskText("File Name", "");
@var $strPath = "";

if ( IsTypeString($strFile) )
{
   $strPath = GetSourcePath() + $strFile;
   SaveStringToFile($strPath, "", 0);
   @var $strCmd = "C:\Program Files\Programmer's Notepad\pn.exe" < type the path of your editor instead >
   MC.Run CMD="{$strCmd}" ARG="{$strPath}"
}