Create a new txt file (the easy way with TXT extension)

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Deltaflight84
Junior Member
Junior Member
Posts: 11
Joined: 2023-08-27, 11:03 UTC

Create a new txt file (the easy way with TXT extension)

Post by *Deltaflight84 »

Good evening guys,
when i press Shift+F4 it creates me and opens with my editor the files that i want to modify, BUT, when i saved it does not have an extension with .txt.
I mean why it happens this?
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Create a new txt file

Post by *Gral »

Probably because you don't type this extension on dialog window.
Deltaflight84
Junior Member
Junior Member
Posts: 11
Joined: 2023-08-27, 11:03 UTC

Re: Create a new txt file

Post by *Deltaflight84 »

i have to type it? there is a way to get it automatically?
KozakMak
Senior Member
Senior Member
Posts: 370
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: Create a new txt file

Post by *KozakMak »

2Deltaflight84
TC remembers history: https://i.imgur.com/oWNgfBp.png
OS: Win10 | TC: latest x64
Deltaflight84
Junior Member
Junior Member
Posts: 11
Joined: 2023-08-27, 11:03 UTC

Re: Create a new txt file

Post by *Deltaflight84 »

how can I create that?
Deltaflight84
Junior Member
Junior Member
Posts: 11
Joined: 2023-08-27, 11:03 UTC

Re: Create a new txt file

Post by *Deltaflight84 »

i mean every time i have to put that, if yes that is no what i need
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Create a new txt file

Post by *Fla$her »

Bind Shift+F4 to cm_Edit with /CL0N=".txt" in the parameters field. Then, each time after the dialog appears, press F4 to move the cursor to the beginning.
If you need to do this without additional pressing, create em_CreateTxt with:
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef "tem(`cm_Edit /CL0N=".txt"`,1) delay(40) send({F4})"
Last edited by Fla$her on 2023-12-15, 11:45 UTC, edited 3 times in total.
Overquoting is evil! 👎
Deltaflight84
Junior Member
Junior Member
Posts: 11
Joined: 2023-08-27, 11:03 UTC

Re: Create a new txt file

Post by *Deltaflight84 »

i don't understand only ho i create the last line, and what is the exact function
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Create a new txt file

Post by *Fla$her »

1. Run cm_Confirmation from the command line (Shift+Left/Right).
2. After selecting the keys, select the appropriate command by pressing the button with a magnifier, and enter the parameters if it is cm_.
You can download TCFS2 in the topic from the specified link and unpack it in the desired path in the TC subdir's.
See also User-defined command.
Overquoting is evil! 👎
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

Re: Create a new txt file

Post by *sa16 »

2Deltaflight84
Try it again and so.
Create user-defined command em_Edit (in usercmd.ini):

Code: Select all

[em_Edit]
cmd=cm_Edit
param=/GCL1N="%A.txt"
Bind Shift+F4 to command em_Edit with ? in the parameters field.
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Create a new txt file

Post by *Fla$her »

In the case of "?" the parameters dialog will appear instead of the file creation dialog. Is it worth it?
L1 is not needed, it's already by default. I specifically gave L0 to make Deltaflight84 feel the difference.
Overquoting is evil! 👎
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Create a new txt file

Post by *beb »

I prefer the following approach:

Code: Select all

[em_dummy_file]
cmd=cm_Edit /C /N="dummy.txt" /L0 /G
The above command creates an empty file whenever I want it wherever I need it.
Then I open it, add some content, and save it under a suitable name regarding the content.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Deltaflight84
Junior Member
Junior Member
Posts: 11
Joined: 2023-08-27, 11:03 UTC

Re: Create a new txt file

Post by *Deltaflight84 »

Thanks to all for the replay and the advice, you guys are really help full thx so much
Post Reply