Skip to main content

Attributes

Host.Attributes(array) wraps a flat key-value array into an Attributes object. Attributes objects are returned by Host.Settings.getAttributes(), context.getArguments(), and passed to storeValues/restoreValues/saveViewState/loadViewState callbacks. They can also be passed as arguments to interpretCommand() calls.

Methods:

MethodReturnsParametersDescription
contains(key)numberkey — the attribute key to checkCheck if attribute exists (returns 1 if found, 0 if not)
countAttributes()numbernoneCount key-value pairs
getAttribute(key)stringkey — the attribute key to look upGet attribute value by key
getAttributeName(index)stringindex — 0-based integerGet attribute key by index
getAttributeValue(index)stringindex — 0-based integerGet attribute value by index
queueAttribute(key, value)key — attribute key to queue, value — attribute value to queueQueue an attribute for batch notification
newQueueIterator(key)objectkey — attribute key to iterate overCreate an iterator over queued attributes
setAttribute(key, value)key — attribute key to set, value — value to assignSet or add an attribute
var attrs = Host.Attributes([
"State", "1",
"Description", "My Description"
]);

Host.GUI.Commands.interpretCommand("View", "Track List", false, attrs);
Host.studioapp.interpretCommand("Zoom", "Zoom Full", false, attrs);