Multi Commander > Script

Create empty text file

(1/2) > >>

matm:
Hello

I have some use cases where i need to create empty text files. I would like to have a button/shortcut for that.
My workflow will be:
- Set the explorer panel in the folder
- Click the button
    * Create an empty text file and put it in rename mode, as it bahevaes currently when using right-click/New/Text Document

Jungle:
Maybe this script will be useful


--- Code: ---@var $s = AskText("Enter file name", "New file.txt", 0);
$s = GetSourcePath() + $s;
SaveStringToFile($s, "", 0);
--- End code ---

It asks you for the file name and then creates empty file. But if a file already exists, it will be overwritten.

Mathias (Author):
Unfortunately I do not think there is a way I set the file into rename mode after that.

Calling one of the internal commands from script would solve that. I been planing to add something like that. I will see if I can add that in the next version.

If you just want to create an empty file you can also write "cf <filename>" in the commandline field. Then an empty file with the given name is created in the current location.


Jungle:

--- Quote from: Mathias (Author) on May 14, 2012, 12:51:38 ---Unfortunately I do not think there is a way I set the file into rename mode after that.
--- End quote ---

Maybe activating in-place rename is not possible, but another way is to use custom command


--- Code: ---MC.Filesystem.Rename ASKNAME
--- End code ---

matm:
Thanks for all answers,
I will check that on Friday.

TY

Navigation

[0] Message Index

[#] Next page

Go to full version