User Tools

Site Tools


macros:example:copymacrobyid

Example

Macro - Copy Macro by MacroId

by: Gregory Haynes, August 2018
published: ./.
description: copy a macro, identifying it by its macroId.
remarks: Best used together with setup/initialize macros, e.g. Create Workspaces

Original idea/request by Alex del Bondio, see http://forum.avolites.com/viewtopic.php?f=20&t=5780.

The main problem when attempting to copy items from the show library is that imported items don't have a dedicated handle - the items from an imported show are displayed dynamically. Hence a way needs to be found how to address an item by other means - in the case of macros: their Id.

functions

affected properties

Code

copyMacroById.xml
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
 <macro id="Avolites.Macros.CopyMacroById" name="Copy Macro Snap to Fixtures #1">
    <description></description>
    <sequence>
      <step>Playbacks.Editor.Macros.SetTargetHandle("Avolites.Macros.SnapForward")</step>
      <step>ActionScript.SetProperty.Enum("Handles.OperationMode", "move")</step>
      <step>Handles.SetSourceHandleFromHandle(Playbacks.Editor.Macros.Target.Handle)</step>
      <step>Handles.CopyDestination("Fixtures", 0)</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 SetTargetHandle call uses the macro ID string to get the handle associated with the macro (even if it is an unassigned factory macro) and assigns that handle to the Playbacks.Editor.Macros.Target.Handle property. This property can then be passed into any other function that requires a handle such as the SetSourceHandleFromHandle function.

How to use it

  • this macro is best used together with other setup macros to copy your preferred macros to locations of your liking
You could leave a comment if you were logged in.
macros/example/copymacrobyid.txt · Last modified: 2019/04/28 00:19 by sideshowbond