Example ====== Show a message prompt ====== ^ by: | Sebastian Beutel, Sept. 2018 | ^ published: | here | ^ description: | some ways to display a message from a macro | ^ remarks: | Useful e.g.to debug your macros. | {{tag>show message prompt error debug alert}} ==== functions ==== * [[:macros:function:Menu.ErrorReport]] * [[:macros:function:ActionScript.SetProperty.String]] * [[macros:function:Menu.PushOrReloadMenu]] * [[macros:function:Math.ToString|]] ==== affected properties ==== * [[:macros:property:Menu.ErrorMessage]] * [[:macros:property:Palette.MasterFadeTime]] ===== Code ===== Menu.ErrorReport('Error.Generic', "Welcome to the world of macros!") ActionScript.SetProperty.String("Menu.ErrorMessage", "This is another message. " + "This is some more text.") Menu.PushOrReloadMenu("Error.Generic") ActionScript.SetProperty.String("Menu.ErrorMessage", "The master fade time is currently " + Math.ToString(Palette.MasterFadeTime) + " seconds") Menu.PushOrReloadMenu("Error.Generic") ===== Explanation ===== This explains the functional steps within the sequence. For all the other XML details please refer to [[:macros:formats_and_syntax#xml_format|Formats and syntax]] The first example just throws a message and prompts to click OK:\\ {{:macros:example:hello_1.png}} The seond example displays another message, here composed of two parts, and stored in a property.\\ {{:macros:example:hello_2.png|}} The third example shows how a numeric value (''Palette.MasterFadeTime'') can be displayed after converting it to a string:\\ {{:macros:example:hello_3.png|}} ===== How to use it ===== See [[:macros:deploying|make this macro available]] However, this is more an example of how you can throw in some lines into your macros to show a message. ~~DISCUSSION~~