Action and Menus
When dealing with macros you'll soon learn that even simple actions might require several steps: in general, programming is a very fine-grained business.
One of the aspects of this is that the menu - which is displayed to you - is independent from the things which are going on inside the programm. And while there might be measures in place to keep menus and the core in sync, there are also occasions where it is your duty to deal with this. In doubt, try to find out if there is a variable you need to set.
One clear example are the Enable/Disable Timecode macros. For testing, I modified the macros and programmed a cuelist to run from the internal timecode. The modified macros are available here: modifiedtimecodemacros.xml
<step>Timecode.SetEnabled(true)</step>
would be all it needs to enable the timecode timer inside the program. However, this does not change the menu to 'Timer Enabled'.- In turn,
<step>ActionScript.SetProperty.Boolean(“Timecode.Enabled”, true)</step>
sets the menu to 'Timer Enabled', and really enables the timer. However, this works only if the timecode menu is open - if it isn't, then this command has no effect. - Hence, the solution is to do both:
<step>ActionScript.SetProperty.Boolean(“Timecode.Enabled”, true)</step>
sets the menu to 'Enabled', and sets the variable which happens to affect the computing core<step>Timecode.SetEnabled(Timecode.Enabled)</step>
directly enables the timer in case the menu isn't open
It is always a good idea to test your macros under various conditions - in particular, with various menus open.
further readings
- Console and simulator - how actions on the consoles are described
- Recorded vs. coded macros - both kinds: Country, AND Western
- Macro file format - what to observe when creating macro files
- Macro Folders - where exactly are the macro files stored
- Deploying macros - how to import a macro file into Titan
- XML format - a veeeery basic introduction into the format macro files are written in
- The Syntax of Functions - understanding how functions are described in general
- Control Structures - conditions and other means to control the flow
- Action and Menus - when a menu needs to be toggled in addition to the action
- Step Pause - a little delay might sometimes be helpful
- Active Binding - highlighting a macro handle as active
- Namespaces - a way to keep order of the functions, properties and other stuff
- Datatypes - numbers, words, yes & no: the various types of values
- Properties list - the affected system variables of Titan
- Function list - the functions mentioned in this wiki
- Examples list - all the contributed macros. And where is yours?