Author Topic: New file shortcut...  (Read 19946 times)

alatar

  • Newbie
  • *
  • Posts: 4
    • View Profile
New file shortcut...
« on: July 14, 2011, 12:40:11 »
Like new folder but to create a file

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4407
    • View Profile
    • Multi Commander
Re: New file shortcut...
« Reply #1 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.

wind.stt

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: New file shortcut...
« Reply #2 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}"
}