How to add a macro to a cuelist cue by macro

This is a place for people to chare the custom macros they have written.

Moderator: Moderators

icke_siegen
Posts: 1087
Joined: 02 Jul 2010, 10:29
Location: Siegen, Germany
Contact:

How to add a macro to a cuelist cue by macro

Postby icke_siegen » 07 Feb 2019, 18:39

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
User avatar
Gregory
Posts: 1300
Joined: 14 Dec 2007, 15:25
Location: London, United Kingdom
Contact:

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

Postby Gregory » 05 Mar 2019, 23:33

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)
User avatar
mad-leo-kitten
Posts: 14
Joined: 19 Feb 2019, 21:46
Contact:

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

Postby mad-leo-kitten » 07 Mar 2019, 15:01

Thaaanks a lot :D thats going to spare a lot of work ^^

its working fine :)

:mrgreen:
icke_siegen
Posts: 1087
Joined: 02 Jul 2010, 10:29
Location: Siegen, Germany
Contact:

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

Postby icke_siegen » 22 Jul 2022, 09:06

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>

Who is online

Users browsing this forum: No registered users and 31 guests