Table of Contents

Example

Create Workspaces

by: Alex del Bondio
published: August 2018
description: Macros to create a custom set of workspaces.
remarks: Used with a new show as you cannot import workspaces yet

The development of this macro can be found here: http://forum.avolites.com/viewtopic.php?f=20&t=5766

The code below only is a snippet of the full macro. The full macro can be found here adb_workspace_creation.xml and the content additional to the snippet is laid out further down.

functions

affected properties

See also Windows for more details about workspace windows.

control structures

Code

adb_workspace_creation_snippet.xml
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
 
<!-- macros to run macros as specified -->
  <macro id="adb.Macros.createworkspaces" name="adb create workspaces">
    <description>Runs the following macros as specified.</description>
    <sequence>
      <step pause="0.001">UserMacros.RecallMacroById("adb.Macros.deleteWorkspace1thru24")</step>
 
      <!--01-->
      <step pause="0.001">UserMacros.RecallMacroById("adb.Macros.CloseAllWindows")</step>
      <step pause="0.001">UserMacros.RecallMacroById("adb.Macros.ws.Playbacks")</step>
      <step pause="0.001">UserMacros.RecallMacroById("adb.Macros.recordworkspace1")</step>
 
      <!--02-->
      <step pause="0.001">UserMacros.RecallMacroById("adb.Macros.CloseAllWindows")</step>
      <step pause="0.001">UserMacros.RecallMacroById("adb.Macros.ws.Program")</step>
      <step pause="0.001">UserMacros.RecallMacroById("adb.Macros.recordworkspace2")</step>
 
      <!-- setup and record some more workspaces -->
 
    </sequence>
  </macro>
 
<!-- Macros to Open Predefined Workspace Windows -->
<!-- Windows.SetWindowRegion("Windows.ChannelGrid", "secondary") needs to be implemented -->
<!-- maximised="False" regionId="primary" scrollOffset seemingly not functional -->
 
  <macro id="adb.Macros.ws.Playbacks" name="adb ws 01_Playbacks">
    <description>opens Workspace Playbacks</description>
    <sequence>
      <step pause="0.001">
        <menuLink id="Windows.Playbacks" stack="mainWindowStack" behaviour="PushOrRaise" maximised="True" regionId="primary" />
      </step>
      <step pause="0.001">UserMacros.RecallMacroById("adb.Macros.MinimiseWindow")</step>
      <step>Windows.SetWindowProperty.X("Windows.Playbacks", 0)</step>
      <step>Windows.SetWindowProperty.Y("Windows.Playbacks", 0)</step>
      <step>Windows.SetWindowProperty.Width("Windows.Playbacks", 2)</step>
      <step>Windows.SetWindowProperty.Height("Windows.Playbacks", 2)</step>
      <step>ActionScript.SetProperty.Enum("Windows.Playbacks.ButtonSize", "Fixed")</step>
      <step>ActionScript.SetProperty.Enum("Windows.Playbacks.TextSize", "Global")</step>
      <step>ActionScript.SetProperty.Integer("Windows.Playbacks.FixedColumns", 12)</step>
      <step>ActionScript.SetProperty.Integer("Windows.Playbacks.FixedRows", 12)</step>
      <step>ActionScript.SetProperty.Boolean("Windows.Playbacks.Pages", true)</step>
      <step>ActionScript.SetProperty.Integer("Windows.Playbacks.CurrentPage", 0)</step>
      <step>Windows.Scrolling.Vertical.Scroll(-100000)</step>
    </sequence>
  </macro>
  <macro id="adb.Macros.ws.Program" name="adb ws 02_Program">
    <description>opens Workspace Program</description>
    <sequence>
      <step pause="0.001">
        <menuLink id="Windows.Groups" stack="mainWindowStack" behaviour="PushOrRaise" maximised="True" regionId="secondary" />
      </step>
      <step>Windows.SetWindowProperty.X("Windows.Groups", 0)</step>
      <step>Windows.SetWindowProperty.Y("Windows.Groups", 0)</step>
      <step>Windows.SetWindowProperty.Width("Windows.Groups", 1)</step>
      <step>Windows.SetWindowProperty.Height("Windows.Groups", 1)</step>
      <step pause="0.001">
        <menuLink id="Windows.Colours" stack="mainWindowStack" behaviour="PushOrRaise" maximised="True" regionId="secondary" />
      </step>
      <step>Windows.SetWindowProperty.X("Windows.Colours", 1)</step>
      <step>Windows.SetWindowProperty.Y("Windows.Colours", 0)</step>
      <step>Windows.SetWindowProperty.Width("Windows.Colours", 1)</step>
      <step>Windows.SetWindowProperty.Height("Windows.Colours", 1)</step>
      <step pause="0.001">
        <menuLink id="Windows.Positions" stack="mainWindowStack" behaviour="PushOrRaise" maximised="True" regionId="secondary" />
      </step>
      <step>Windows.SetWindowProperty.X("Windows.Positions", 0)</step>
      <step>Windows.SetWindowProperty.Y("Windows.Positions", 1)</step>
      <step>Windows.SetWindowProperty.Width("Windows.Positions", 1)</step>
      <step>Windows.SetWindowProperty.Height("Windows.Positions", 1)</step>
      <step pause="0.001">
        <menuLink id="Windows.Beams" stack="mainWindowStack" behaviour="PushOrRaise" maximised="True" regionId="secondary" />
      </step>
      <step>Windows.SetWindowProperty.X("Windows.Beams", 1)</step>
      <step>Windows.SetWindowProperty.Y("Windows.Beams", 1)</step>
      <step>Windows.SetWindowProperty.Width("Windows.Beams", 1)</step>
      <step>Windows.SetWindowProperty.Height("Windows.Beams", 1)</step>
    </sequence>
  </macro>  
 
<!-- Macros to Record Workspace Windows -->
  <macro id="adb.Macros.recordworkspace1" name="adb record workspace1">
    <description>Record Workspace 1.</description>
    <sequence>
      <step>Workspace.Record(Handles.CreateHandleReference("Workspaces", 0, 0), "Playbacks", 0, true, false)</step>
      <step>ActionScript.SetProperty("Handles.AllowEditWorkspaces", true)</step>
      <step>Handles.SetSourceHandle("Workspaces", 0)</step>
      <step>ActionScript.SetProperty("Handles.CurrentUserNumber", userNumber:1)</step>
      <step>Handles.SetUserNumber()</step>
      <step>Handles.ClearSelection()</step>
      <step>ActionScript.SetProperty("Handles.AllowEditWorkspaces", false)</step>
    </sequence>
  </macro>
  <macro id="adb.Macros.recordworkspace2" name="adb record workspace2">
    <description>Record Workspace 2.</description>
    <sequence>
      <step>Workspace.Record(Handles.CreateHandleReference("Workspaces", 0, 1), "Program", 0, false, true)</step>
      <step>ActionScript.SetProperty("Handles.AllowEditWorkspaces", true)</step>
      <step>Handles.SetSourceHandle("Workspaces", 1)</step>
      <step>ActionScript.SetProperty("Handles.CurrentUserNumber", userNumber:2)</step>
      <step>Handles.SetUserNumber()</step>
      <step>Handles.ClearSelection()</step>
      <step>ActionScript.SetProperty("Handles.AllowEditWorkspaces", false)</step>
    </sequence>
  </macro>
 
<!-- Macros to delete Workspace Windows -->
  <macro id="adb.Macros.deleteWorkspace1thru24" name="adb delete workspace 1 through 24">
    <description>adb Delete Workspace 1-24</description>
    <sequence>
      <step pause="0.001">ActionScript.SetProperty.Boolean("Handles.AllowEditWorkspaces", true)</step>
      <step pause="0.001">Handles.SetSourceHandleFromHandle("workspaceHandleUN=1")</step>
      <step pause="0.001">Handles.ConfirmDelete()</step>
      <step pause="0.001">Handles.SetSourceHandleFromHandle("workspaceHandleUN=2")</step>
      <step pause="0.001">Handles.ConfirmDelete()</step>
      <step pause="0.001">Handles.SetSourceHandleRange("Workspaces", {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11})</step>
      <step pause="0.001">Handles.ConfirmDelete()</step>
      <step pause="0.001">ActionScript.SetProperty.Boolean("Handles.AllowEditWorkspaces", false)</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 code above is only a snippet to give you an idea of what is going on in the macro, the full macro will include the following:

How to use it

  1. This macro is intented to be called when a new show is started - it deletes the factory workspaces and sets up new workspaces.