TC 11.00 b10 how to use cm_Edit with parameters ?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Galizza
Senior Member
Senior Member
Posts: 201
Joined: 2018-09-07, 05:21 UTC

TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *Galizza »

 

Hi, i'm trying to use cm_Edit to edit current file with associated program assigned on [Associations] using this new feature

Code: Select all

05.07.23 Added: cm_Edit with parameters: Option to open the file with associated program instead of editor, either with or without using internal associations (32/64)
 
I've tried

Code: Select all

TOTALCMD#BAR#DATA
cm_Edit
%P%N
wcmicons.dll,28
Edit current file with associated program


-1
 
but it doesn't work, may you help me ?, thanks.

 
Tc 11.00b10 32Bits // Windows 10 22H2 32Bits
Last edited by Galizza on 2023-07-06, 08:39 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *petermad »

See example here: viewtopic.php?t=79523
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Galizza
Senior Member
Senior Member
Posts: 201
Joined: 2018-09-07, 05:21 UTC

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *Galizza »

petermad wrote: 2023-07-06, 08:39 UTC See example here: viewtopic.php?t=79523
 
Thanks, i've been trying but i must be missing something because it doesn't work.
May you tell me how to edit existing file using %P%N ?  Best regards :!:
 
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *petermad »

It is not parameters like %P%N - it is like this:
Help wrote:cm_Edit
The following parameters can be passed to the function behind a slash:
C: Create files which do not already exit
T: Instead of creating an empty file, copy a template file to the new name. By default, the user's template directory will be used. The first file in it with the same extension will be copied to the new file. If no file is found, an empty file will be created
T="c:\path": Sames as T but use the specified template directory
N="name": The name(s) of the file(s) to be created
G: Go, create new files immediately (has no effect when not using C)
L: Launch type: L0=do not launch, L1=open with default editor, L2=open with associated program (including internal associations), L3=open with associated program (no internal associations)
V="verb": Combined with L2 or L3, set the verb to open the file, e.g. "open" or "edit". Leave out for default verb.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *Stefan2 »

The help also should show some examples, IMHO. At least ONE.

Example:
CMD: cm_Edit
PARAM: /CN="new file.txt"L0
PARAM: /CN="new file3.txt|new file4.txt" L1
PARAM: /CN="new file5.txt|new file6.txt|new file7.txt" (sometimes same as L0, sometimes same as L1)
PARAM: /CGN="new file9.txt|new file99.txt|new file79.txt" (same as L0 too ???)




What is G good for?

Just FYI, this un-quoted doesn't work for me:
/CN=MyNewFile.TXT


This one-liner works in TC-commandline, but not on a button in CMD field only (see petermad's link above)
cm_Edit /CN="new file155.txt|new file156.txt|new file157.txt" (works as L0)



 
User avatar
Galizza
Senior Member
Senior Member
Posts: 201
Joined: 2018-09-07, 05:21 UTC

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *Galizza »

2petermad & Stefan2

Thanks :!:
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *petermad »

2Stefan2
What is G good for?
It creates the file without prompting the name.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JOUBE
Power Member
Power Member
Posts: 1664
Joined: 2004-07-08, 08:58 UTC

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *JOUBE »

Help -> Index -> "Dialog box: Choose command" -> "Dialog box: Choose command" -> [ Show ] > Tab -> Ctlr+F -> cm_edit ->

Code: Select all

cm_Edit The following parameters can be passed to the function behind a slash:
	C: Create files which do not already exit
	T: Instead of creating an empty file, copy a template file to the new name. By default, the user's template
	   directory will be used. The first file in it with the same extension will be copied to the new file. If no 
	   file is found, an empty file will be created
	T="c:\path": Sames as T but use the specified template directory
	N="name": The name(s) of the file(s) to be created
	G: Go, create new files immediately (has no effect when not using C)
	L: Launch type: L0=do not launch, L1=open with default editor, L2=open with associated program (including
	   internal associations), L3=open with associated program (no internal associations)
	V="verb": Combined with L2 or L3, set the verb to open the file, e.g. "open" or "edit". Leave out for default 
	   verb.
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *petermad »

Button to open the Help with em_commands that supports parameters:

Code: Select all

TOTALCMD#BAR#DATA
hh.exe %COMMANDER_PATH%\TOTALCMD.CHM::dlg_choosecommand.htm 

%COMMANDER_PATH%\TOTALCMD.CHM
Open Help for Choose Commands (cm_commands with parameters)
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *Stefan2 »

petermad wrote: 2023-07-06, 17:45 UTC 2Stefan2
What is G good for?
It creates the file without prompting the name.

Ah, thank you.

How should that work?

This doesn't work for me in TC11b10:
cm_Edit /CGN="new file1255.txt|new file1256.txt|new file1257.txt"
cm_Edit /GCN="new file1255.txt|new file1256.txt|new file1257.txt"


EDIT:
according to my post yesterday, it had worked?!? for me , but not today?!?
I will try more...

 
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *petermad »

2Stefan2
cm_Edit /CGN="new file1255.txt|new file1256.txt|new file1257.txt"
remember that if you use it in a button, then /CGN="new file1255.txt|new file1256.txt|new file1257.txt" has to be in the Parameters field. https://ghisler.ch/board/viewtopic.php?t=79523
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *Stefan2 »

petermad wrote: 2023-07-07, 08:35 UTC remember that if you use it in a button, then /CGN="x" has to be in the Parameters field.

Yes, you're right.


I don't know what I have tested in the morning, but of course that way it works for me now (again).

------------------------------
TOTALCMD#BAR#DATA
cm_Edit
/CGN="new file1.txt|new file2.txt|new file3.txt"
wcmicons.dll,28
Create "new file.txt" ( C=Create ; G=silently ; N="name1|name2" ; no L=do not open after creation, same as LØ)


-1
------------------------------



note to myself: perform tests only between 1000 and 2200
 
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC 11.00 b10 how to use cm_Edit with parameters ?

Post by *ghisler(Author) »

remember that if you use it in a button, then /CGN="x" has to be in the Parameters field.
That's a known bug, it will work also in the name field in the next beta version.
Author of Total Commander
https://www.ghisler.com
Post Reply