MA2 Macro Trick #2 - User Input (Showfile inside)

3 min read 1 month ago
Published on Aug 02, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial covers the second macro trick from aGuyNamedJonas's series, focusing on using user input to make your macros reusable. By incorporating user input, you can easily adjust settings within your macros for various scenarios, enhancing their flexibility and efficiency.

Step 1: Understanding User Input

User input allows you to reuse macros by prompting for specific values when the macro is executed. This means you don’t have to hard-code values into your macros, making them adaptable.

How to Implement User Input

  1. Start with a Command: Write a basic command. For example:

    set fixture dimmer level 11
    
  2. Add User Input: Modify your command to include user input by adding parentheses. For instance, change the command to:

    set fixture dimmer level (Enter fixture or range)
    
  3. Execute the Macro: When you run the macro, a prompt will appear asking for the fixture number. Enter the desired fixture (e.g., "5") and hit enter. The command will now be:

    set fixture dimmer level 5
    

Step 2: Using Value Ranges with User Input

You can also apply user input to define value ranges for your commands, allowing for even greater control over your macros.

How to Set Value Ranges

  1. Modify the Command: Change your command to include a value range. For example:

    set fixture dimmer level (Enter fixture or range) at (Enter dimmer level)
    
  2. Run the Macro: When executed, the macro will prompt for both the fixture and the dimmer level. For example:

    • Enter fixture: 2
    • Enter dimmer level: 22
  3. Use Complete Commands: You can also input multiple fixtures or ranges. For example:

    select fixtures (6 through 10) at (1 through 100)
    

Step 3: Utilizing the @ Sign for Sequential Input

Another method to gather user input involves the use of the @ sign, which pauses the execution of the macro until the necessary inputs are provided.

How to Implement the @ Sign

  1. Add the @ Sign: At the end of your macro line, include the @ sign. For example:

    set fixture dimmer level @
    
  2. Run the Macro: When you trigger this macro, it will display the command line without executing it yet. You can enter the desired values.

  3. Complete the Command: After entering your values, press enter. The macro will then prompt for the additional inputs defined within parentheses.

  4. Final Execution: Once all values are provided, the command is executed with the new inputs.

Conclusion

By leveraging user input in your macros, you can significantly enhance their versatility and reuse them for various scenarios. This not only saves time but also streamlines your workflow. To continue improving your macro programming skills, make sure to check out the next videos in the series and experiment with the showfile provided. Happy coding!