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 {{tag>record workspace delete windows}} The code below only is a snippet of the full macro. The full macro can be found here {{ :macros:example:adb_workspace_creation.xml }} and the content additional to the snippet is laid out further down. ==== functions ==== * [[macros:function:UserMacros.RecallMacroById]] * [[macros:function:Windows.Scrolling.Vertical.Scroll]] * [[macros:function:Workspace.Record]] * [[macros:function:Handles.SetSourceHandle]] * [[macros:function:Handles.SetUserNumber]] * [[macros:function:Handles.SetSourceHandleFromHandle]] * [[macros:function:Handles.ConfirmDelete]] * [[macros:function:Handles.SetSourceHandleRange]] * [[macros:function:Windows.SetWindowProperty.X]] * [[macros:function:Windows.SetWindowProperty.Y]] * [[macros:function:Windows.SetWindowProperty.Width]] * [[macros:function:Windows.SetWindowProperty.Height]] ==== affected properties ==== * the respective window's attributes (x, y, height, width), see [[macros:identifier:windows]] * [[macros:property:Windows.windowId.ButtonSize]] * [[macros:property:Windows.windowId.TextSize]] * [[macros:property:Windows.windowId.FixedColumns]] * [[macros:property:Windows.windowId.FixedRows]] * [[macros:property:Windows.windowId.Pages]] * [[macros:property:windows.windowid.currentpage]] * [[macros:property:Handles.AllowEditWorkspaces]] See also [[macros:identifier:windows]] for more details about workspace windows. ==== control structures ==== * [[macros:control_structures:menulink|menuLink]] ===== Code ===== Runs the following macros as specified. UserMacros.RecallMacroById("adb.Macros.deleteWorkspace1thru24") UserMacros.RecallMacroById("adb.Macros.CloseAllWindows") UserMacros.RecallMacroById("adb.Macros.ws.Playbacks") UserMacros.RecallMacroById("adb.Macros.recordworkspace1") UserMacros.RecallMacroById("adb.Macros.CloseAllWindows") UserMacros.RecallMacroById("adb.Macros.ws.Program") UserMacros.RecallMacroById("adb.Macros.recordworkspace2") opens Workspace Playbacks UserMacros.RecallMacroById("adb.Macros.MinimiseWindow") Windows.SetWindowProperty.X("Windows.Playbacks", 0) Windows.SetWindowProperty.Y("Windows.Playbacks", 0) Windows.SetWindowProperty.Width("Windows.Playbacks", 2) Windows.SetWindowProperty.Height("Windows.Playbacks", 2) ActionScript.SetProperty.Enum("Windows.Playbacks.ButtonSize", "Fixed") ActionScript.SetProperty.Enum("Windows.Playbacks.TextSize", "Global") ActionScript.SetProperty.Integer("Windows.Playbacks.FixedColumns", 12) ActionScript.SetProperty.Integer("Windows.Playbacks.FixedRows", 12) ActionScript.SetProperty.Boolean("Windows.Playbacks.Pages", true) ActionScript.SetProperty.Integer("Windows.Playbacks.CurrentPage", 0) Windows.Scrolling.Vertical.Scroll(-100000) opens Workspace Program Windows.SetWindowProperty.X("Windows.Groups", 0) Windows.SetWindowProperty.Y("Windows.Groups", 0) Windows.SetWindowProperty.Width("Windows.Groups", 1) Windows.SetWindowProperty.Height("Windows.Groups", 1) Windows.SetWindowProperty.X("Windows.Colours", 1) Windows.SetWindowProperty.Y("Windows.Colours", 0) Windows.SetWindowProperty.Width("Windows.Colours", 1) Windows.SetWindowProperty.Height("Windows.Colours", 1) Windows.SetWindowProperty.X("Windows.Positions", 0) Windows.SetWindowProperty.Y("Windows.Positions", 1) Windows.SetWindowProperty.Width("Windows.Positions", 1) Windows.SetWindowProperty.Height("Windows.Positions", 1) Windows.SetWindowProperty.X("Windows.Beams", 1) Windows.SetWindowProperty.Y("Windows.Beams", 1) Windows.SetWindowProperty.Width("Windows.Beams", 1) Windows.SetWindowProperty.Height("Windows.Beams", 1) Record Workspace 1. Workspace.Record(Handles.CreateHandleReference("Workspaces", 0, 0), "Playbacks", 0, true, false) ActionScript.SetProperty("Handles.AllowEditWorkspaces", true) Handles.SetSourceHandle("Workspaces", 0) ActionScript.SetProperty("Handles.CurrentUserNumber", userNumber:1) Handles.SetUserNumber() Handles.ClearSelection() ActionScript.SetProperty("Handles.AllowEditWorkspaces", false) Record Workspace 2. Workspace.Record(Handles.CreateHandleReference("Workspaces", 0, 1), "Program", 0, false, true) ActionScript.SetProperty("Handles.AllowEditWorkspaces", true) Handles.SetSourceHandle("Workspaces", 1) ActionScript.SetProperty("Handles.CurrentUserNumber", userNumber:2) Handles.SetUserNumber() Handles.ClearSelection() ActionScript.SetProperty("Handles.AllowEditWorkspaces", false) adb Delete Workspace 1-24 ActionScript.SetProperty.Boolean("Handles.AllowEditWorkspaces", true) Handles.SetSourceHandleFromHandle("workspaceHandleUN=1") Handles.ConfirmDelete() Handles.SetSourceHandleFromHandle("workspaceHandleUN=2") Handles.ConfirmDelete() Handles.SetSourceHandleRange("Workspaces", {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}) Handles.ConfirmDelete() ActionScript.SetProperty.Boolean("Handles.AllowEditWorkspaces", false) ===== Explanation ===== This explains the functional steps within the sequence. For all the other XML details please refer to [[macros:formats_and_syntax#xml_format|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: * This is a collection of macros that will delete existing workspaces and replace them with workspaces defined in this code * This collection is divided into labeled subparts. Best practice is to collapse all lines and go through it step by step * The main macro ''adb create workspaces'' will only run other macros without further code * ''macros to run macros as specified'' is the main macro that will run macros as defined * ''Macros to Open Predefined Workspace Windows'' these macros will open predefined window configurations * ''Macros to Open other Windows'' are macros to open workspace windows as you know from the console. Included are windows you'll only find in certain menus (e.g. triggers) * ''Macros to Record Workspace Windows'' these macros will record the actual workspaces * ''Macros to delete Workspace Windows'' will delete all existing workspaces on the handles and unassigned ones with user number 1-24 * ''Macros to Control Workspace Windows'' are stock macros to control window size, position etc * ''Show Library options'' Show Library display options which I use for my show (one column of macros right next to the show library window) * ''Channel Grid options'' Channel Grid display options - same as for Show Library * ''Playback View / Cue View options'' stock macros to control playback/cuelist view (e.g. next/prev cue) ===== How to use it ===== - [[macros:deploying|make this macro available]] - This macro is intented to be called when a new show is started - it deletes the factory workspaces and sets up new workspaces. ~~DISCUSSION~~