Rank: Newbie
Groups: Registered
Joined: 4/22/2019(UTC) Posts: 8 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!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: FlorinU 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") )
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/22/2019(UTC) Posts: 8 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 :(
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: FlorinU 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"
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/22/2019(UTC) Posts: 8 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]
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: FlorinU [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 ;-)
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/22/2019(UTC) Posts: 8 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-626e2bbcc708I am stuck here for 5 days. Any idea? Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: FlorinU 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-626e2bbcc708I 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"))
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/22/2019(UTC) Posts: 8 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: FlorinU 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/23/2019(UTC) Posts: 556
Thanks: 62 times Was thanked: 130 time(s) in 118 post(s)
|
Originally Posted by: FlorinU 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-626e2bbcc708I am stuck here for 5 days. Any idea? Thanks Hint: Don't mix American and British English in scripts! ;)
|
2 users thanked dmwkr for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/22/2019(UTC) Posts: 8 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!
|
|
|
|
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