Running a command with Special Symbols handling

Here you can discuss any topic concerning Far macro commands.
Post Reply
pepak
Posts: 624
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 62 times

Running a command with Special Symbols handling

Post 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).
Shmuel
Posts: 7230
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 48 times
Been thanked: 631 times

Running a command with Special Symbols handling

Post 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.
User avatar
HaRT
Moderator
Posts: 11446
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 270 times
Been thanked: 415 times

Running a command with Special Symbols handling

Post 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.
Фар есть инструмент, а не нянька. © 2009 DrKnS
Post Reply

Return to “Macro Commands Discussions”