News:

MultiCommander v16.6 is released!

Main Menu

Button Editor: Create New Text File

Started by IainC, November 23, 2019, 12:08:11

Previous topic - Next topic

IainC

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.

Ulfhednar

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

Mathias (Author)

#2
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

IainC

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]

AlanJB

QuoteI tried  SaveStringToFile(MyReadMe.txt,"",0)

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