vMix Forums
»
General
»
3rd Party Software and Development
»
Vmix Scripting | How can I get into a variable a DynamicValue
Rank: Newbie
Groups: Registered
Joined: 9/14/2022(UTC) Posts: 2  Location: Lleida
|
Hi guys,
I need to read into a variable a Dynamic Value but I don't know where to start.
I have three shortcuts which sets different Dynamic Values. (35, 40 and 45).
My script is supposed to read those numbers and do some stuff depending which number is set up.
Thanks in advance.
Mateo
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,329  Location: Belgium Thanks: 299 times Was thanked: 981 time(s) in 814 post(s)
|
Originally Posted by: mateogallegotv  Hi guys,
I need to read into a variable a Dynamic Value but I don't know where to start.
I have three shortcuts which sets different Dynamic Values. (35, 40 and 45).
My script is supposed to read those numbers and do some stuff depending which number is set up.
Thanks in advance.
Mateo DynamicInputs and DynamicValues are intended to make functions used in scripts dynamic , not as a general variable storage space That said you can use them as such by reading their content through the API XML within a script just like any other item from that xml or if one does not want to deal with xpaths for reading said xml one can use a title as intermediate holdingplace Code:
API.Function("SetDynamicValue1",Value:="40" )
' --By reading the API XML ---------------------------------------
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim demo as string = (x.SelectSingleNode("//dynamic/value1").InnerText)
console.writeLine("demo : " & demo)
' --OR if one does not want to deal with reading API XML (intended use of DynamicInputs and values)----------
API.Function("SetDynamicInput1",Value:="Title.gtzip" )
API.Function("SetDynamicValue1",Value:="35" )
API.Function("SetText",Input:="Dynamic1",SelectedName:="Headline.Text",Value:="Dynamic1" )
'OR
Input.Find("Dynamic1").Text("Headline.Text")= "Dynamic1"
dim test as string = Input.Find("Title.gtzip").Text("Headline.Text")
console.writeLine("demo : " & test)
Check out "Scripting for dummies" post in this forum
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 9/14/2022(UTC) Posts: 2  Location: Lleida
|
Originally Posted by: doggy  Originally Posted by: mateogallegotv  Hi guys,
I need to read into a variable a Dynamic Value but I don't know where to start.
I have three shortcuts which sets different Dynamic Values. (35, 40 and 45).
My script is supposed to read those numbers and do some stuff depending which number is set up.
Thanks in advance.
Mateo DynamicInputs and DynamicValues are intended to make functions used in scripts dynamic , not as a general variable storage space That said you can use them as such by reading their content through the API XML within a script just like any other item from that xml or if one does not want to deal with xpaths for reading said xml one can use a title as intermediate holdingplace Code:
API.Function("SetDynamicValue1",Value:="40" )
' --By reading the API XML ---------------------------------------
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim demo as string = (x.SelectSingleNode("//dynamic/value1").InnerText)
console.writeLine("demo : " & demo)
' --OR if one does not want to deal with reading API XML (intended use of DynamicInputs and values)----------
API.Function("SetDynamicInput1",Value:="Title.gtzip" )
API.Function("SetDynamicValue1",Value:="35" )
API.Function("SetText",Input:="Dynamic1",SelectedName:="Headline.Text",Value:="Dynamic1" )
'OR
Input.Find("Dynamic1").Text("Headline.Text")= "Dynamic1"
dim test as string = Input.Find("Title.gtzip").Text("Headline.Text")
console.writeLine("demo : " & test)
Check out "Scripting for dummies" post in this forum Thanks!! Using a Title as placeholder could work.
|
|
|
|
vMix Forums
»
General
»
3rd Party Software and Development
»
Vmix Scripting | How can I get into a variable a DynamicValue
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close