Page 1 of 2

Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-17, 21:51 UTC
by Slavic
First of all, thanks for long-awaited option to assign several commands in a chain to a toolbar button in beta 3! However, UI can be improved to better support this option.

Currently, when we look for a particular command in the "Choose command" list and then insert it by "OK", the previous commands for current button, if they existed, become deleted. This makes difficult to add a sequence of commands by searching one-by-one in this UI.

I suggest to not delete the existing commands in the "Command:" field; user can do it on their own. Instead, insert the chosen command at the cursor position. This way, it will be much easier to add several commands to a chain.

Also, it could be helpful to check and add separating commas, if they are missed, but such service is very optional and can be implemented later.

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-17, 22:15 UTC
by petermad
when we look for a particular command in the "Choose command" list and then insert it by "OK", the previous commands for current button, if they existed, become deleted
If there is a comma after the previous command AND the cursor is at the end of the Command field, then the new selected command get appended to the end.

It would be nice if the chosen command could also be inserted before commands that already exists in the field,

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-17, 22:46 UTC
by Slavic
petermad wrote: 2023-05-17, 22:15 UTC It would be nice if the chosen command could also be inserted before commands that already exists in the field,
It's exactly what I tested, attempting to add a new command at the begin of chain (in particular, cm_FocusRight).

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-17, 22:49 UTC
by petermad
Support++++

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-18, 04:39 UTC
by Fla$her
Slavic wrote: 2023-05-17, 21:51 UTC First of all, thanks for long-awaited option to assign several commands in a chain to a toolbar button in beta 3!
What are you talking about?
HISTORY.TXT wrote:27.08.13 Release Total Commander 8.50 public beta 1 (32/64)
17.02.13 Added: Support for multiple internal (cm_xyz) or user-defined (em_xyz) commands on a single button or start menu command: Separate by a comma, e.g. cm_SelectAll,cm_Copy. Not all commands can be chained this way! (32/64)

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-18, 07:17 UTC
by ghisler(Author)
Maybe he meant EM_COMMANDs with parameters?

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-18, 08:08 UTC
by Slavic
ghisler(Author) wrote: 2023-05-18, 07:17 UTC Maybe he meant EM_COMMANDs with parameters?
15.05.23 Added: Button bar, start menu: Multiple user-defined internal commands with parameters can now be chained, e.g. em_notepad c:path\file1,em_notepad c:path\file2 (32/64)

(Apparently my phrase wasn't clear about exact addition, sorry about that)

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-18, 08:11 UTC
by Fla$her
2Slavic
If you are writing about parameters, then you need to go to my topic.
Slavic wrote: 2023-05-17, 21:51 UTCfor long-awaited option
No one wrote a word in support. Is it implied that I alone have waited so long? :lol:

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-18, 08:22 UTC
by Slavic
Please look at the discussion a few years ago: https://www.ghisler.ch/board/viewtopic.php?t=72726
At that times, unlike now, the command like this didn't work:
cm_FocusRight,cd "c:\Windows\"

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-18, 10:12 UTC
by Fla$her
2Slavic
You have given a line of history above regarding em_ commands. It doesn't say anything about cd etc. And in the rest of the lines of the history it is not written anywhere about it. This is apparently a side effect that you have stumbled upon. But this is good news!

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-18, 10:48 UTC
by sa16
Slavic wrote: At that times, unlike now, the command like this didn't work:
cm_FocusRight,cd "c:\Windows\"
More than a year has passed:
History.txt wrote:12.04.22 Release Total Commander 10.50 beta 1
08.03.22 Added: Button bar, Start menu: command "cd" can now be combined with internal commands, but the path must be in double quotes, e.g. cm_SrcShort,cd "c:\Windows" (32/64)

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-19, 15:29 UTC
by jinsight
Support++ in support of the support by petermad

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-05-22, 10:03 UTC
by ghisler(Author)
When you append a comma, the chosen command will already be put behind it. I will add the same when the existing command starts with a comma followed by an internal command or cd "path".

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-07-13, 21:36 UTC
by petermad
2ghisler(Author)

It is still not possible to insert cm_commands between or before existing commands via choosing the command from the "Choose Command" dialog - trying to insert a command deletes all other commands - it is only possible to append commands at the end.

In the "View Modes" -> "Auto-run commands" field trying to insert a command via the [+] button, just appends it, even without adding a trailing comma first. Same thing with the "Lister: view methods by file type" when using the [+] button to add Lister view modes

It would be nice if all these dialogs supporting insertion when the cursor is placed right after a comma. It would be OK if the user had to add an extra comma manually and place the cursor between those two commas, to indicate where the insertion is wanted.

Re: Allow add/insert a command to chain for button from Choose command UI

Posted: 2023-07-14, 09:33 UTC
by ghisler(Author)
Just append the command then then use cut+paste.