Page 1 of 2

Make button from em command and em command from button

Posted: 2017-05-14, 08:42 UTC
by DrShark
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.

Posted: 2017-05-14, 09:06 UTC
by MVV
* to the user command edit dialog add the item "Copy as a button"
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 button edit dialog add a the item "Make user command from this button"
It would be much better here to open standard command brower and its command creation dialog...

Posted: 2017-05-14, 10:29 UTC
by Vochomurka

Posted: 2017-05-14, 13:07 UTC
by DrShark
MVV wrote:
DrShark wrote:* to the button edit dialog add a the item "Make user command from this button"
It would be much better here to open standard command brower and its command creation dialog...
By "item" I meant an additionl row in the button edit dialog that looks like this:
Suggested interface wrote:Make user command from this button: [em_newname_____] [Create...]
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.)

2Vochomurka
Thanks, I will try it.

Posted: 2017-05-15, 07:29 UTC
by MVV
By "item" I meant an additionl row in the button edit dialog that looks like this:
Too much unnecessary extra space. User-command name is not a necessary parameter for a button, and for user-command buttons its name will already be in the Command field, so this line will be redundant.

Posted: 2017-05-15, 08:24 UTC
by Lefteous
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

Posted: 2017-05-15, 12:22 UTC
by MVV
Lefteous,
Replacing buttons with em-commands will complicate exchange of buttons/buttonbars, 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)...

Posted: 2017-05-15, 12:33 UTC
by Lefteous
2MVV
Replacing buttons with em-commands will complicate exchange of buttons/buttonbars
No, why should it?
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)...
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.

Posted: 2017-05-15, 13:38 UTC
by MVV
No, why should it?
E.g. you wouldn't be able to just copy a BAR file with EM-dependencies.
The problem is always section size and they are much larger in buttonbar files then they are in usercmd.ini.
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.

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...

Posted: 2017-05-15, 14:05 UTC
by Lefteous
E.g. you wouldn't be able to just copy a BAR file with EM-dependencies.
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...
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.

Posted: 2017-05-15, 14:52 UTC
by MVV
And I'm afraid 99% of users would expect internal solutions...

Posted: 2017-05-15, 18:30 UTC
by Lefteous
Internal solutions for what? A unified command editor or something else? In this case I agree. Absolutely standard in many applications nowadays.

Posted: 2017-05-15, 19:47 UTC
by MVV
In case of EM-commanded buttonbars there will be also required a way for exporting/importing independent buttonbar...

Posted: 2017-05-15, 20:22 UTC
by DrShark
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
MVV wrote:...its name will already be in the Command field, so this line will be redundant.
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.
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.

Re: Make button from em command and em command from button

Posted: 2017-05-15, 20:47 UTC
by ts4242
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"
You can use both Extended Command Editor and Button Bar Editor to Copy any command/button in TOTALCMD#BAR#DATA format then Paste anywhere.