Make button from em command and em command from button
Moderators: white, Hacker, petermad, Stefan2
Make button from em command and em command from button
To make it easier to test complex buttons with many em_ commands used, and to make easier the creation of the em_ command itself, I have following suggestions:
* to the user command edit dialog add the item "Copy as a button" that will copy the fields of user command in TOTALCMD#BAR#DATA format.
* to the button edit dialog add a the item "Make user command from this button" with an additional input field to set a name for new user command and a button "Create..." after pressing which the dialog of editing our em_ command with all fields from our button already added will be opened so user will just have to confirm the creation.
* to the user command edit dialog add the item "Copy as a button" that will copy the fields of user command in TOTALCMD#BAR#DATA format.
* to the button edit dialog add a the item "Make user command from this button" with an additional input field to set a name for new user command and a button "Create..." after pressing which the dialog of editing our em_ command with all fields from our button already added will be opened so user will just have to confirm the creation.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
This item may be added to Change button's menu for both full (all buttons) and mini (one button and usercommand) button edit dialogs.* to the user command edit dialog add the item "Copy as a button"
It would be much better here to open standard command brower and its command creation dialog...* to the button edit dialog add a the item "Make user command from this button"
- Vochomurka
- Power Member
- Posts: 814
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
By "item" I meant an additionl row in the button edit dialog that looks like this:MVV wrote:It would be much better here to open standard command brower and its command creation dialog...DrShark wrote:* to the button edit dialog add a the item "Make user command from this button"
Click on [Create...] should open a user command creation dialog (called "Change user command") with our em_newname in title and with the values from button fields already added to it. I'm not sure about the need of opening the cm_CommandBrowser window too because if user will need the command browser for something it's possible to open it right from user command creation dialog by clicking on the [...] button (the one placed left from [Change >>] button.)Suggested interface wrote:Make user command from this button: [em_newname_____] [Create...]
2Vochomurka
Thanks, I will try it.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Please also consider this larger suggestion which includes creating a em commando automatically when creating a button. In other words all places where a user command can be inserted should be based on em commands.
http://www.ghisler.ch/wiki/index.php?title=Unified_command_launcher_editor
http://www.ghisler.ch/wiki/index.php?title=Unified_command_launcher_editor
2MVV
No, why should it?Replacing buttons with em-commands will complicate exchange of buttons/buttonbars
For me it seems it's just the way around. The problem is always section size and they are much larger in buttonbar files then they are in usercmd.ini.also there are limits on INI file size and number of EM commands which will cause more problems (currently such limits are only a problem for a few TC users who create thousands of EM-commands)...
E.g. you wouldn't be able to just copy a BAR file with EM-dependencies.No, why should it?
Exactly. Total size of all buttonbar files may be much greater than size of a single INI file, therefore a bunch of BAR files has less limitations than single usercmd.ini file.The problem is always section size and they are much larger in buttonbar files then they are in usercmd.ini.
Also merging multiple buttonbars would be more complicated due to merging usercmd.ini files, and you would need additional tools for detecting dead EM-commands...
E.g. you wouldn't be able to just copy a BAR file with EM-dependencies.
I think this are mainly tooling problems. More importantly I consider the stuff you mentioned as edge cases. We need a solution that works for 99% of the user.Also merging multiple buttonbars would be more complicated due to merging usercmd.ini files, and you would need additional tools for detecting dead EM-commands...
2Vochomurka
I tried your script and it does the job (required PowerPro update from my 3.8 to 5.x)! The only thing I miss is the ability to edit the user command before the command will be finally created (it may help if the user command I want to make should have some minor differences with the button).
2MVV
2Lefteous
I do not support the merging of a button and a em-command to a single thing. Why? User command may be used not only in a button, but also in Start menu, Directory menu, Command line or just be assigned to a hotkey. I just don't see the point in making the additional button record for each em command.
I tried your script and it does the job (required PowerPro update from my 3.8 to 5.x)! The only thing I miss is the ability to edit the user command before the command will be finally created (it may help if the user command I want to make should have some minor differences with the button).
2MVV
Well, this will work if after a click on [Create...] button TC will auto-open Command Browser, then auto-focus on "usercmd.ini" item, then auto-click the [New...] button and will auto-suggset the new usercommand name (like mentioned Button2em script does,) and finally after user will confirm the name (or give a different one) for em command, TC should open "Change user command" with the same values of its fields like in our button.MVV wrote:...its name will already be in the Command field, so this line will be redundant.
2Lefteous
I do not support the merging of a button and a em-command to a single thing. Why? User command may be used not only in a button, but also in Start menu, Directory menu, Command line or just be assigned to a hotkey. I just don't see the point in making the additional button record for each em command.
Last edited by DrShark on 2017-05-15, 21:23 UTC, edited 1 time in total.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Re: Make button from em command and em command from button
You can use both Extended Command Editor and Button Bar Editor to Copy any command/button in TOTALCMD#BAR#DATA format then Paste anywhere.DrShark wrote:* to the user command edit dialog add the item "Copy as a button" that will copy the fields of user command in TOTALCMD#BAR#DATA format.
* to the button edit dialog add a the item "Make user command from this button"