Page 1 of 1

Retrieve current Macro Name?

PostPosted: Fri Sep 06, 2024 3:36 pm
by evanevery
Anyone aware of a method to return the name of the Macro which is currently executing? (IOW: a method for a macro to determine its own name)

I've been using the Macro Name in the title bar of any messages I display (for clarity). I've been using a locally defined variable to hold the macro name/ID. However, since many folks will change the macro name (particularly for user button assignments), it would be much more elegant if there was a method I could use for the macro to get its own name/ID on the fly...

Re: Retrieve current Macro Name?

PostPosted: Wed Oct 16, 2024 10:59 pm
by cncdrive
Try the this.macronumber variable.

Re: Retrieve current Macro Name?

PostPosted: Wed Oct 23, 2024 7:58 am
by sebba
Hello,
Unfortunately is not working

[CS1061 | in line: 11 | error text: 'Macroclass' does not contain a definition for 'macronumber' and no extension method 'macronumber' accepting a first argument of type 'Macroclass' could be found (are you missing a using directive or an assembly reference?)