Page 1 of 1

How to add a macro to a cuelist cue by macro

Posted: 07 Feb 2019, 18:39
by icke_siegen
As part of a larger 'setup my show for me' macro we want to add a macro to a cuelist cue.

This is what I am currently trying:

Code: Select all

ActionScript.SetProperty("Playbacks.PlaybackEdit.Handle",(Handles.GetHandle("PlaybackWindow",0,1)))
ActionScript.SetProperty("Playbacks.PlaybackEdit.CurrentStep",1.0)
Playbacks.Editor.Macros.SetTargetHandle("Avolites.Macros.SnapForward")
Playbacks.Editor.Macros.AddLink(Playbacks.Editor.Macros.Target.Handle)


However, it doesn't work, and the log says
System.NullReferenceException... at Avolites.Titan.Controllers.Editor.Playbacks.PlaybackMacroEditor.AddLink(Handle handle)
. But which object is missing? Thanks in advance for your help!

Sebastian

Re: How to add a macro to a cuelist cue by macro

Posted: 05 Mar 2019, 23:33
by Gregory
The problem you are having is due to the required cue not being selected properly. The property Playbacks.PlaybackEdit.CurrentStep is used for displaying in menus what the current cue number is, setting it has no impact on the selection - part of the reason for this is that the cue selection can contain multiple cues and is therefore not just a single number.

What you should try instead is:

Code: Select all

Playbacks.Editor.CueSelection.SelectCueByNumber(Handles.GetHandle("PlaybackWindow",0,1), 1.0)
Playbacks.Editor.Macros.SetTargetHandle("Avolites.Macros.SnapForward")
Playbacks.Editor.Macros.AddLink(Playbacks.Editor.Macros.Target.Handle)

Re: How to add a macro to a cuelist cue by macro

Posted: 07 Mar 2019, 15:01
by mad-leo-kitten
Thaaanks a lot :D thats going to spare a lot of work ^^

its working fine :)

:mrgreen:

Re: How to add a macro to a cuelist cue by macro

Posted: 22 Jul 2022, 09:06
by icke_siegen
Just a note for the casual reader: at least in Titan v15 the above code throws an error indicating a type conversion problem. What I found does work is this code:

Code: Select all

<step pause="0.001">Playbacks.Editor.CueSelection.SelectCueByNumber(Handles.GetHandle("Playbacks",0,1), 2.0)</step>
<step pause="0.001">Playbacks.Editor.Macros.AddLinkFromId("Avolites.Macros.SnapForward")</step>