logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
mateogallegotv  
#1 Posted : Wednesday, September 14, 2022 6:23:19 PM(UTC)
mateogallegotv

Rank: Newbie

Groups: Registered
Joined: 9/14/2022(UTC)
Posts: 2
Spain
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
doggy  
#2 Posted : Wednesday, September 14, 2022 7:30:34 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,216
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: mateogallegotv Go to Quoted Post
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


mateogallegotv  
#3 Posted : Wednesday, September 14, 2022 7:38:56 PM(UTC)
mateogallegotv

Rank: Newbie

Groups: Registered
Joined: 9/14/2022(UTC)
Posts: 2
Spain
Location: Lleida

Originally Posted by: doggy Go to Quoted Post
Originally Posted by: mateogallegotv Go to Quoted Post
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.
Users browsing this topic
Guest (3)
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.