Example
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 |
File with some more windows' pages here: pagename.xml
<?xml version="1.0" encoding="utf-8"?> <avolites.macros> <macro id="Wiki.Macros.Test.PageName" name="PageName"> <sequence> <step>ActionScript.SetProperty("UserMacros.CurrentUserNumber", Handles.Macros.Page.Index)</step> <step>Handles.Macros.ChangePage(1)</step> <step>Handles.SetSourceHandleFromHandle("cueHandleUN=1001")</step> <step>Handles.ConfirmDelete()</step> <step>ActionScript.SetProperty("Playbacks.PendingLegend", Handles.Playbacks.Page.DisplayName)</step> <step>Playbacks.StoreCue("Macros", 0, false)</step> <step>Handles.SetSourceHandle("Macros", 0)</step> <step>ActionScript.SetProperty("Handles.CurrentUserNumber", userNumber:1001)</step> <step>Handles.SetUserNumber()</step> <step>Handles.SetSourceHandleFromHandle("cueHandleUN=1002")</step> <step>Handles.ConfirmDelete()</step> <step>ActionScript.SetProperty("Playbacks.PendingLegend", Math.ToString(Handles.Playbacks.Page.DisplayIndex))</step> <step>Playbacks.StoreCue("Macros", 1, false)</step> <step>Handles.SetSourceHandle("Macros", 1)</step> <step>ActionScript.SetProperty("Handles.CurrentUserNumber", userNumber:1002)</step> <step>Handles.SetUserNumber()</step> <step>Handles.ClearSelection()</step> <step>Handles.Macros.ChangePage(UserMacros.CurrentUserNumber)</step> </sequence> </macro> </avolites.macros>
This explains the functional steps within the sequence. For all the other XML details please refer to Formats and syntax
Handles.SetSourceHandleFromHandle(..)
selects the handle for the following delete actionHandles.ConfirmDelete()
deletes this handleActionScript.SetProperty(“Playbacks.PendingLegend”, Handles.Playbacks.Page.DisplayName)
loads the current pagename of a window into the variable Playbacks.PendingLegendPlaybacks.StoreCue(“Macros”, 0, false)
stores a dummy cue on the current Macros page's first button and sets its legendHandles.SetSourceHandle(“Macros”, 0)
selects this handle to set its usernumberActionScript.SetProperty(“Handles.CurrentUserNumber”, userNumber:1001)
prepares the usernumber to be set for the specific handleHandles.SetUserNumber()
sets the usernumber