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
FlorinU  
#1 Posted : 3 years ago
FlorinU

Rank: Newbie

Groups: Registered
Joined: 4/22/2019(UTC)
Posts: 8
Romania
Location: BUCURESTI

Thanks: 1 times
Could anyone write me a few lines of script to change the color of a text based on the value of another text, please?
Source text should be the required hex code.
Thank you!
doggy  
#2 Posted : 3 years ago
doggy

Rank: Advanced Member

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

Thanks: 300 times
Was thanked: 989 time(s) in 821 post(s)
Originally Posted by: FlorinU Go to Quoted Post
Could anyone write me a few lines of script to change the color of a text based on the value of another text, please?
Source text should be the required hex code.
Thank you!


Code:
API.Function("SetTextColour",Input:="Titlename",SelectedName:="textfield",Value:=Input.Find("Titlename").Text("thecolour.Text") )
FlorinU  
#3 Posted : 3 years ago
FlorinU

Rank: Newbie

Groups: Registered
Joined: 4/22/2019(UTC)
Posts: 8
Romania
Location: BUCURESTI

Thanks: 1 times
API.Function("SetTextColour",Input:="TEAMS",SelectedName:="ColorTeamA",Value:=Input.Find("TEAMS").Text("ColourTeamB.Text"))

Value in ColorTeamB.Text is #FE1F41


Nothing happens :(
doggy  
#4 Posted : 3 years ago
doggy

Rank: Advanced Member

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

Thanks: 300 times
Was thanked: 989 time(s) in 821 post(s)
Originally Posted by: FlorinU Go to Quoted Post
API.Function("SetTextColour",Input:="TEAMS",SelectedName:="ColorTeamA",Value:=Input.Find("TEAMS").Text("ColourTeamB.Text"))

Value in ColorTeamB.Text is #FE1F41


Nothing happens :(


Just a guess based on so much information given like a screenshot of the title editor and such: is this really the name of the textfield ? "ColorTeamA"
FlorinU  
#5 Posted : 3 years ago
FlorinU

Rank: Newbie

Groups: Registered
Joined: 4/22/2019(UTC)
Posts: 8
Romania
Location: BUCURESTI

Thanks: 1 times
[img=https://qf70pfk.sharing.bublup.com/ui/landing_page?item_id=001-i-3e9cdee6-2b77-4f67-9564-255314dd41e3]Snap[/img]
doggy  
#6 Posted : 3 years ago
doggy

Rank: Advanced Member

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

Thanks: 300 times
Was thanked: 989 time(s) in 821 post(s)
Originally Posted by: FlorinU Go to Quoted Post
[img=https://qf70pfk.sharing.bublup.com/ui/landing_page?item_id=001-i-3e9cdee6-2b77-4f67-9564-255314dd41e3]Snap[/img]


Like i said ( guessed) before , it's not ColorTeamA !
look at what you used for the B one ;-)
FlorinU  
#7 Posted : 3 years ago
FlorinU

Rank: Newbie

Groups: Registered
Joined: 4/22/2019(UTC)
Posts: 8
Romania
Location: BUCURESTI

Thanks: 1 times
OK, the code is this:
API.Function("SetTextColour",Input:="TEAMS",SelectedName:="ColorTeamA.Text",Value:=Input.Find("TEAMS").TEXT("ColourTeamB.Text"))
Value in B is: #F91F41
And A gets an 8 zeroes Hex code that sets alpha 0.
https://qf70pfk.sharing....2-4463-869a-626e2bbcc708

I am stuck here for 5 days.

Any idea?

Thanks
doggy  
#8 Posted : 3 years ago
doggy

Rank: Advanced Member

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

Thanks: 300 times
Was thanked: 989 time(s) in 821 post(s)
Originally Posted by: FlorinU Go to Quoted Post
OK, the code is this:
API.Function("SetTextColour",Input:="TEAMS",SelectedName:="ColorTeamA.Text",Value:=Input.Find("TEAMS").TEXT("ColourTeamB.Text"))
Value in B is: #F91F41
And A gets an 8 zeroes Hex code that sets alpha 0.
https://qf70pfk.sharing....2-4463-869a-626e2bbcc708

I am stuck here for 5 days.

Any idea?

Thanks



you want to have the text in ColorTeamA.Text to be the color that you specified by code in ColourTeamB.Text. this is what this script line is doing. are you running/excecuting the script ?
On the other hand if you want the color of the text to match the code that is written in the text field then use the same textfield twice
Code:
API.Function("SetTextColour",Input:="TEAMS",SelectedName:="ColorTeamA.Text",Value:=Input.Find("TEAMS").TEXT("ColourTeamA.Text"))
FlorinU  
#9 Posted : 3 years ago
FlorinU

Rank: Newbie

Groups: Registered
Joined: 4/22/2019(UTC)
Posts: 8
Romania
Location: BUCURESTI

Thanks: 1 times
I need option A
Yes, I am running/executing the script, that's exactly what gets me to the 8 zeroes

Would you give it a try at that script?

Thanks.

F
doggy  
#10 Posted : 3 years ago
doggy

Rank: Advanced Member

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

Thanks: 300 times
Was thanked: 989 time(s) in 821 post(s)
Originally Posted by: FlorinU Go to Quoted Post

Would you give it a try at that script?

Thanks.

F


Any Script i post has been tested first!

The result you are getting does not make sense , or some information is missing in what you are doing or trying to do
dmwkr  
#11 Posted : 3 years ago
dmwkr

Rank: Advanced Member

Groups: Registered
Joined: 2/23/2019(UTC)
Posts: 576

Thanks: 62 times
Was thanked: 135 time(s) in 123 post(s)
Originally Posted by: FlorinU Go to Quoted Post
OK, the code is this:
API.Function("SetTextColour",Input:="TEAMS",SelectedName:="ColorTeamA.Text",Value:=Input.Find("TEAMS").TEXT("ColourTeamB.Text"))
Value in B is: #F91F41
And A gets an 8 zeroes Hex code that sets alpha 0.
https://qf70pfk.sharing....2-4463-869a-626e2bbcc708

I am stuck here for 5 days.

Any idea?

Thanks


Hint: Don't mix American and British English in scripts! ;)
thanks 2 users thanked dmwkr for this useful post.
doggy on 3/23/2022(UTC), FlorinU on 4/7/2022(UTC)
FlorinU  
#12 Posted : 3 years ago
FlorinU

Rank: Newbie

Groups: Registered
Joined: 4/22/2019(UTC)
Posts: 8
Romania
Location: BUCURESTI

Thanks: 1 times


Hint: Don't mix American and British English in scripts! ;)


Rookie mistake, my bad, now I understand why suddenly it started working (no colo(ur) in the names)

However, vMix has this also mixed in the colo(u)r functions for Title: "SetColor" and "SetTextColour" :)

Thanks for the help!
Users browsing this topic
Guest
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.