macros:example:exportmacro
Table of Contents
Example
Macro - Export Macro
by: | Gregory Haynes, Jan 2016 |
---|---|
published: | http://forum.avolites.com/viewtopic.php?f=20&t=4361#p15847 |
description: | exports macro no.1 as file in the usermacro location |
functions
Code
- ExportMacro.xml
<?xml version="1.0" encoding="utf-8"?> <avolites.macros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Avolites.Menus.xsd"> <!-- Macro to export another macro. Gregory Haynes 13/02/2016 --> <macro id="Avolites.Macros.ExportMacro" name="Export Macro Number 1"> <description>Exports the macro with user number 1.</description> <sequence> <step>UserMacros.SetCurrentMacroFromUserNumber(1)</step> <step>UserMacros.Export(UserMacros.CurrentMacroId)</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
<step>UserMacros.SetCurrentMacroFromUserNumber(1)</step>
makes the macro with the usernumer 1 current, i.e. selects it. Change the number if you want to export another macro.<step>UserMacros.Export(UserMacros.CurrentMacroId)</step>
actually exports the previously selected macro - all the file handling is done in this function
See also http://forum.avolites.com/viewtopic.php?f=20&t=5733 for hints on exporting more macros.
How to use it
- create another macro and give this macro usernumber 1
- find the Export macro in the show library or via
<Macro>
[View All]
and execute (click) it - open Windows explorer and navigate to your usermacro location
- there you'll find a file named Macro1.xml - this is the exported macro
macros/example/exportmacro.txt · Last modified: 2019/04/27 22:19 by sideshowbond
Discussion
Successfully tried this various times myself.