Access full macro name from within the macro

Hello,
I want to imprint the full name of the macro which I am using on all figures it produces.
Is there any way to access the full name of a macro from within it?
Thanks any advice.

There is surely many ways. For instance:

root [2] gSystem->Which(gSystem->WorkingDirectory(),"greek.C")
(char* 0x7fa75415c920)"/Users/couet/roottest/greek.C"

Ok, thanks. But eventually this thing returns you a path to the macro. Can I also to get an echo of the macro name itself? The macro names contain a version number, so I want to trace it on the figures.

Ah ok … you want to find the macro name inside the macro itself…
I looked around but did not find anything yet doing that …
May be somebody else has an idea… I’ll check a bit more.

Hi,

Try this way:gInterpreter->GetCurrentMacroName();
Or if you want the macro name only, without the full path:

Cheers, Bertrand.

Hi,
The first option works just as I wanted, thank you!