Table of Contents

Example

Store cues with current page names as legends

by: Sebastian Beutel
published: May 2024
description: store cues with current pagenames as legends
remarks: This records some cues into the Macros window and sets their legends to the current pages legends of some windows.
Page legends are not available through WebAPI. In order to get these legends:
- deploy this macro
- recall it from WebAPI http://localhost:4431/titan/script/2/UserMacros/RecallMacroById?macroId=Wiki.Macros.Test.PageName
- get handles JSON http://localhost:4431/titan/handles/Macros
- parse the answer for the numbers/legends you are after

functions

affected properties

File with some more windows' pages here: pagename.xml

Code

pagename.xml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <avolites.macros>
  3.  
  4. <macro id="Wiki.Macros.Test.PageName" name="PageName">
  5. <sequence>
  6.  
  7. <step>ActionScript.SetProperty("UserMacros.CurrentUserNumber", Handles.Macros.Page.Index)</step>
  8. <step>Handles.Macros.ChangePage(1)</step>
  9.  
  10. <step>Handles.SetSourceHandleFromHandle("cueHandleUN=1001")</step>
  11. <step>Handles.ConfirmDelete()</step>
  12. <step>ActionScript.SetProperty("Playbacks.PendingLegend", Handles.Playbacks.Page.DisplayName)</step>
  13. <step>Playbacks.StoreCue("Macros", 0, false)</step>
  14. <step>Handles.SetSourceHandle("Macros", 0)</step>
  15. <step>ActionScript.SetProperty("Handles.CurrentUserNumber", userNumber:1001)</step>
  16. <step>Handles.SetUserNumber()</step>
  17.  
  18. <step>Handles.SetSourceHandleFromHandle("cueHandleUN=1002")</step>
  19. <step>Handles.ConfirmDelete()</step>
  20. <step>ActionScript.SetProperty("Playbacks.PendingLegend", Math.ToString(Handles.Playbacks.Page.DisplayIndex))</step>
  21. <step>Playbacks.StoreCue("Macros", 1, false)</step>
  22. <step>Handles.SetSourceHandle("Macros", 1)</step>
  23. <step>ActionScript.SetProperty("Handles.CurrentUserNumber", userNumber:1002)</step>
  24. <step>Handles.SetUserNumber()</step>
  25.  
  26. <step>Handles.ClearSelection()</step>
  27. <step>Handles.Macros.ChangePage(UserMacros.CurrentUserNumber)</step>
  28.  
  29. </sequence>
  30. </macro>
  31. </avolites.macros>

Explanation

This explains the functional steps within the sequence. For all the other XML details please refer to Formats and syntax

How to use it

  1. parse the answer for the numbers/legends you are after