Page 1 of 1

How to create a master with a macro?

Posted: 16 Feb 2019, 12:25
by icke_siegen
Currently trying to create a master by macro, like this:

Code: Select all

    <step>Masters.AssignMaster("FlashMaster", "Location=Playbacks,1,6")</step>


I also tried a longer version like this:

Code: Select all

    <step>Handles.SetSourceHandleFromHandle("Location=Playbacks,1,6")</step>
    <step>Masters.SetContext("FlashMaster")</step> 
    <step>Masters.AssignMaster(Masters.ContextString, Handles.SourceHandle)</step>


But neither works - the logs always show a null reference exception. Where is the fault?

Re: How to create a master with a macro?

Posted: 05 Mar 2019, 23:43
by Gregory
In this case the handle parameter requires a handle reference which defines a location which may or may not have a handle assigned to it. As both the string notation is attempting to get an assigned handle at the specified location it returns nothing (null) if there is no handle there. There is a function to return a handle reference called Handles.CreateHandleReference which you can use:

Code: Select all

Masters.AssignMaster("FlashMaster", Handles.CreateHandleReference("Playbacks",0,0))