====== 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 [[macros:example:timecodeonoff|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: {{ :macros:modifiedtimecodemacros.xml }}
* ''Timecode.SetEnabled(true)'' 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, ''ActionScript.SetProperty.Boolean("Timecode.Enabled", true)'' 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:
* ''ActionScript.SetProperty.Boolean("Timecode.Enabled", true)'' sets the menu to 'Enabled', and sets the variable which happens to affect the computing core
* ''Timecode.SetEnabled(Timecode.Enabled)'' 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.**
~~NOCACHE~~
{{page>macros:formats_and_syntax#further_readings}}
~~DISCUSSION~~