Multi Commander Support Forum

Multi Commander => Support and Feedback => Topic started by: IainC on November 23, 2019, 12:08:11

Title: Button Editor: Create New Text File
Post by: IainC on November 23, 2019, 12:08:11
I would like to have a Button that creates a new, blank, pre-named text file, and which, ideally, then opens in Notepad.  If not the opening bit then, at least, the file would have focus so that I can just press Enter to open it into Notepad from the Explorer Window.  I can do this, almost, bwo a simple Batch File, but I can't eliminate a brief flash of a cmd window.  I know it is possible because I did it ages ago, but then lost that installation of MC (through a corruption of an extension file), and now can't remember how I managed it.  Any pointers would be much appreciated.
Title: Re: Button Editor: Create New Text File
Post by: Ulfhednar on November 23, 2019, 16:22:15
Shift+F4 brings up a notepad instance.
I think you could script it or use the custom commands feature in the button editor with MC/edit/  etc
Title: Re: Button Editor: Create New Text File
Post by: Mathias (Author) on November 23, 2019, 18:46:55
You can type cf <filename> in the command line field to create a empty file with that name

or you can script using MultiScript if you really want a button
Like SaveStringToFile and save and empty string and you get an empty file
Title: Re: Button Editor: Create New Text File
Post by: IainC on November 27, 2019, 13:43:27
Thanks, Mathias.  I haven't ever used MultiScript, so I may need more of a hand-hold: I tried  SaveStringToFile(MyReadMe.txt,"",0); as a User-Created MultiScript Command, which I linked to a Button (but it didn't do anything).

[My Batch File was
call>MyReadMe.txt
start /B  %windir%\notepad.exe MyReadMe.txt
exit
But, as I said, this produces a brief flash of the cmd window]
Title: Re: Button Editor: Create New Text File
Post by: AlanJB on November 27, 2019, 14:47:35
Quote
I tried  SaveStringToFile(MyReadMe.txt,"",0)

The first argument needs to be the complete path to the file, including drive and folder(s).