Hi John,
Maybe an important note - macros are not supported in ASCX transformation, only txt and HTML transformations are supported.
In ASCX transformation you can use the SCRIPT tags and use the API or you need to create a custom transformation method.
Best regards,
Juraj Ondrus