How to copy/transfer a macro into a Layout using AddLayoutElements?
Posted: 28 Aug 2025, 01:40
Hi everyone,
I’m trying to figure out the correct way to place a macro from the Macros window into a Layout via XML / ActionScript.
So far I tried something like this:
<step>Layouts.AddLayoutElements(handle:"Location=Layouts,1,1",
handles:"Location=Macros,1,11",
x:0, y:0)</step>
…but it doesn’t seem to work. The macro gets selected, but nothing is actually added to the Layout.
I also tried with Handles.SetSourceHandleFromHandle before calling AddLayoutElements, but still no success.
What is the correct method to either copy a macro into a Layout or transfer/link it there programmatically? Do I need to use AddSelectedHandleToLayout, or is there another approach for macros specifically?
I’m trying to figure out the correct way to place a macro from the Macros window into a Layout via XML / ActionScript.
So far I tried something like this:
<step>Layouts.AddLayoutElements(handle:"Location=Layouts,1,1",
handles:"Location=Macros,1,11",
x:0, y:0)</step>
…but it doesn’t seem to work. The macro gets selected, but nothing is actually added to the Layout.
I also tried with Handles.SetSourceHandleFromHandle before calling AddLayoutElements, but still no success.
What is the correct method to either copy a macro into a Layout or transfer/link it there programmatically? Do I need to use AddSelectedHandleToLayout, or is there another approach for macros specifically?