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
Speegs  
#1 Posted : Thursday, July 30, 2020 4:55:47 PM(UTC)
Speegs

Rank: Advanced Member

Groups: Registered
Joined: 8/3/2013(UTC)
Posts: 388
Location: Gold Coast, Australia

Thanks: 25 times
Was thanked: 72 time(s) in 56 post(s)
Hello,

I'm trying to use Scripting in Vmix to toggle an element based on what some text says. Any hints from a guru on what I'm doing wrong here.

I know my if statement is good, just trying to make a rectangle in GT Designer, display or not based on the content of a title and failing. Can you do this for items from GT Designer or only images?

If Input.Find("MM-Top.gtzip").Text("OnlineText.Text") = "1" Then
API.Function("SetVisibleOn","MM-Top.gtzip","OnlineRect")
Else
API.Function("SetVisibleOff","MM-Top.gtzip","OnlineRect")
End If
doggy  
#2 Posted : Thursday, July 30, 2020 5:33:54 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,525
Belgium
Location: Belgium

Thanks: 141 times
Was thanked: 454 time(s) in 373 post(s)
GT page and use SelectIndex
thanks 1 user thanked doggy for this useful post.
Speegs on 7/31/2020(UTC)
Speegs  
#3 Posted : Thursday, July 30, 2020 11:09:08 PM(UTC)
Speegs

Rank: Advanced Member

Groups: Registered
Joined: 8/3/2013(UTC)
Posts: 388
Location: Gold Coast, Australia

Thanks: 25 times
Was thanked: 72 time(s) in 56 post(s)
Thanks pointed me just enough in the right direction (to find the Youtube tutorial on pages). Also looking at Onchange of data option in the designer, since it's on/off might be useful without a script to do on change. I'll test that for my purpose.
doggy  
#4 Posted : Thursday, July 30, 2020 11:17:15 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,525
Belgium
Location: Belgium

Thanks: 141 times
Was thanked: 454 time(s) in 373 post(s)
Originally Posted by: Speegs Go to Quoted Post
Thanks pointed me just enough in the right direction (to find the Youtube tutorial on pages). Also looking at Onchange of data option in the designer, since it's on/off might be useful without a script to do on change. I'll test that for my purpose.


GT title On Change only handles a change , not a value check
You will have to go with script


thanks 1 user thanked doggy for this useful post.
Speegs on 7/31/2020(UTC)
Speegs  
#5 Posted : Friday, July 31, 2020 11:56:33 AM(UTC)
Speegs

Rank: Advanced Member

Groups: Registered
Joined: 8/3/2013(UTC)
Posts: 388
Location: Gold Coast, Australia

Thanks: 25 times
Was thanked: 72 time(s) in 56 post(s)
Script was the best way.. here is the exact code in case it helps someone out. This worked for me.

The IsOnline.Text is under our company logo so nobody can see it changing from 0 to 1. It's being populated via a XML data source with a bunch of other standard title text fields.

Code:

Sleep(100)
Dim TitlePage as Integer = 1
Do While true
  If Input.Find("MM-Top.gtzip").Text("IsOnline.Text") = "1" Then
   If TitlePage = 1 Then
      TitlePage = 2
      API.Function("SelectIndex","MM-Top.gtzip","2")
   End If
  Else
   If TitlePage = 2 Then
      TitlePage = 1
      API.Function("SelectIndex","MM-Top.gtzip","1")
   End If
  End If   
  Sleep(100)
Loop


The only improvement I guess could be triggering the VBScript when the data reloads from the data source manager.

I have no idea how to do that, probably not possible. Would make a good feature to trigger a script based on the Update data ever xxx milliseconds on the data source facility. If someone has a way I'm all ears :)
Users browsing this topic
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.