Internal command for "Create new text file" (SHIFT

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
dapa1
Junior Member
Junior Member
Posts: 7
Joined: 2009-07-31, 16:24 UTC
Location: Helsinki

Internal command for "Create new text file" (SHIFT

Post by *dapa1 »

Hi,
is it possible to have an internal command cm_xxx for "Create new text file" (SHIFT+F4)?
Then I can create a button for it and also assign new key.
Thanks,
Daniel
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, unfortunately not - F4 is cm_edit, and the same command handles Shift+F4 (it checks for the pressed Shift key)...
Author of Total Commander
https://www.ghisler.com
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, Daniel.

Let me give you the translated workaround which HolgerK posted in the German forum just a few weeks ago:
HolgerK wrote:

Code: Select all

Set WshShell = WScript.CreateObject( "WScript.Shell" ) 
WshShell.SendKeys("+{F4}")
Save this as "TCShiftF4.vbs" and drag it onto the T.C. buttonbar.
Assuming that on most Windows machines, the Windows Scripting Host will be present, this is a pretty portable solution which uses only 83 bytes.
HTH,
Karl
lsgdcity
Junior Member
Junior Member
Posts: 34
Joined: 2008-11-10, 07:51 UTC

Post by *lsgdcity »

But even Shift + F4 is pretty cool.
Just enter a filename which doesn't exist and this file will be created and opened by your default editor.

That's what I was looking for. Thank you.
(I didn't know that Shift + F4 exist).

By the way: I didn't find a command like "Create new file" which I could use with another shortcut.

P.S.: Yes, it's an old topic, but maybe my answers helps to push this in some search engines ;-)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You can simply call an EXE file that will do what you want (create a new file w/o opening an editor, create 10 files at once etc). It is a common way of calling external functionality, and there is no need for VBS here.
Post Reply