Page 1 of 1

Running a command with Special Symbols handling

Posted: Sun 29 Mar, 2026 13:57
by pepak
Is it possible to create a macro that would run a command with similar Special Symbols handling as used in the User Menu, Apply Command or Associated Commands? E.g. I'd like to map a key to run

Code: Select all

something.exe "!.!"
, the caveat being that I need all of the ! symbols, not just !.!. I don't want to create a special item in the User Menu and I don't want to modify the history in Apply Command (otherwise I would just invoke CTRL+G and type the command).

Running a command with Special Symbols handling

Posted: Sun 29 Mar, 2026 14:33
by Shmuel
As far as I know it is not currently possible.
But it seems to be easy to add a new plugins-API or macro-API function that would expand the input string and return the result.
It may be called e.g. ExpandSpecialSymbols or ExpandMetaSymbols.

Running a command with Special Symbols handling

Posted: Sun 29 Mar, 2026 14:41
by HaRT
pepak wrote: Sun 29 Mar, 2026 13:57 I don't want to modify the history in Apply Command (otherwise I would just invoke CTRL+G and type the command)
I don't know a good solution, but perhaps you could open the Apply Command dialog, disable the input history (using DIF_HISTORY and/or DM_SETHISTORY), then paste and run your command.
Shmuel wrote: Sun 29 Mar, 2026 14:33 ExpandSpecialSymbols
I'd vote for this name. Maybe “templates” would be even more meaningful. Calling these “meta” symbols always seemed inappropriate to me.