User Tools

Site Tools


macros:example:exportmacro

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

  1. create another macro and give this macro usernumber 1
  2. find the Export macro in the show library or via <Macro> [View All] and execute (click) it
  3. open Windows explorer and navigate to your usermacro location
  4. there you'll find a file named Macro1.xml - this is the exported macro

Discussion

icke_siegen, 2017/10/15 08:52

Successfully tried this various times myself.

You could leave a comment if you were logged in.
macros/example/exportmacro.txt · Last modified: 2019/04/27 22:19 by sideshowbond

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki