I'm tracking utilization of macros in a library I'm developing by writing a record to a database every time a macro is called. I do this by adding tools to the end of the macro that push a record to a database table for this purpose.
The record contains an expression "[Engine.WorkflowDirectory] + [Engine.WorkflowFileName]" to collect the macro's parent workflow details, and hard coded string fields representing the macro's file name and directory path.
Even when the macro is doing the writing to the database, the [Engine] constants still refer to the workflow details of the parent workflow, not the workflow details of the macro itself.
I'm hoping to make this truly automated and move away from needing to configure the hard-coded strings every time I drop these tools into a new macro. But I can't figure out how to dynamically access the file name of the macro itself without the [Engine] constants being available.
Any suggestions?