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: 903
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
Site Admin
Posts: 1114
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:

Who is online

Users browsing this forum: No registered users and 3 guests