User Tools

Site Tools


macros:example:shomessage

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.

functions

affected properties

Code

showmessages.xml
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
 
  <macro id="Avolites.Macros.Hello" name="Hello Macro">
    <sequence>
      <step>Menu.ErrorReport('Error.Generic', "Welcome to the world of macros!")</step>
    </sequence>
  </macro>
 
  <macro id="Avolites.Macros.2lineerror" name="Another error">
    <sequence>
      <step>ActionScript.SetProperty.String("Menu.ErrorMessage", 
             "This is another message. " + "This is some more text.")</step>
      <step>Menu.PushOrReloadMenu("Error.Generic")</step>
    </sequence>
  </macro>
 
  <macro id="Avolites.Macros.showfadetime" name="Show Fade Time">
    <sequence>
      <step>ActionScript.SetProperty.String("Menu.ErrorMessage", 
             "The master fade time is currently " + Math.ToString(Palette.MasterFadeTime) + " seconds")</step>
      <step>Menu.PushOrReloadMenu("Error.Generic")</step>
    </sequence>
  </macro>
 
</avolites.macros>

Explanation

This explains the functional steps within the sequence. For all the other XML details please refer to Formats and syntax

The first example just throws a message and prompts to click OK:

The seond example displays another message, here composed of two parts, and stored in a property.

The third example shows how a numeric value (Palette.MasterFadeTime) can be displayed after converting it to a string:

How to use it

See 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.

You could leave a comment if you were logged in.
macros/example/shomessage.txt · Last modified: 2018/09/16 17:00 by icke_siegen