| 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,447  Location: BelgiumThanks: 311 timesWas thanked: 1006 time(s) in 830 post(s)
 
 | 
            
		      
                Have more variables into 1 DynamicValue and select them by their position(number) and update Code:API.Function("SetDynamicValue1",Value:="value1,value2,value3,value4")
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim MyValues as string = (x.SelectSingleNode("//dynamic/value1").InnerText)
dim MyVals() as string = MyValues.Split(",")
For i As Integer = 0 To MyVals.Length - 1
Console.WriteLine(MyVals(i))
Next
'replace one of the values
MyVals(1) = "Cat"
'save the updated values
Dim result As String = String.Join(",", str2)
API.Function("SetDynamicValue1",Value:=result )
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Member
 Groups: Registered
Joined: 1/6/2014(UTC)
 Posts: 15
 
 Thanks: 3 timesWas thanked: 1 time(s) in 1 post(s)
 
 | 
            
		      
                Originally Posted by: doggy  Launch external applicationCode:'Launch an application and resume the script  when  app is closed 
Dim P As New Process
    P = Process.Start("notepad.exe")
    P.WaitForExit()
'Launch an application (example notepad with specified existing file)
Dim ExtApp As New ProcessStartInfo
ExtApp.FileName = "notepad.exe"
ExtApp.Arguments = "d:/demo.txt"
ExtApp.UseShellExecute = True
ExtApp.WindowStyle = ProcessWindowStyle.Normal
Dim proc As Process = Process.Start(ExtApp)
 I need to run .bat file please help! | 
    | 
              1 user thanked endiaer for this useful post. |  | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,447  Location: BelgiumThanks: 311 timesWas thanked: 1006 time(s) in 830 post(s)
 
 | 
            
		      
                Originally Posted by: endiaer  
 I need to run .bat file please help!
 Just replace the notepad.exe with your xxx.bat file (first example) | 
    | 
              1 user thanked doggy for this useful post. |  | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Member
 Groups: Registered
Joined: 1/6/2014(UTC)
 Posts: 15
 
 Thanks: 3 timesWas thanked: 1 time(s) in 1 post(s)
 
 | 
            
		      
                Helo, is it possible to trigger something based on a certain time value in the timer? my  timer is 10:00 minutes and i want to make a script to start streaming at the left 01:00. Thank you. | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,447  Location: BelgiumThanks: 311 timesWas thanked: 1006 time(s) in 830 post(s)
 
 | 
            
		      
                Originally Posted by: endiaer  Helo, is it possible to trigger something based on a certain time value in the timer? my  timer is 10:00 minutes and i want to make a script to start streaming at the left 01:00. Thank you. Sure read the current displayed time within the title from the API XML and code your decision and commands based on that . How to get that info (time) has been addressed in previous posts here | 
    | 
              1 user thanked doggy for this useful post. |  | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 11/23/2020(UTC) Posts: 217  Location: WichitaThanks: 11 timesWas thanked: 29 time(s) in 25 post(s)
 
 | 
            
		      
                The small icon or logo that appears then disappears on network television is called a "bug".  It's not present all the time because it can cause burn in issues (faint ghost of the bug visible even when it's not being shown) on the screens displaying the video. I wrote a simple script to turn the bug on for one minute out of every five minutes Code:
'Bug control, turn on the Identity Bug for one minute out of every five minutes
console.writeline ( "Bug control started")
Dim BugIsOn as boolean = false
API.Function("OverlayInput4Out")
Do While True
     Dim LastDigitOfMinutes as string = DateTime.Now.ToString("mm").substring(1,1)
     if BugIsOn then
        If LastDigitOfMinutes <> "5" and LastDigitOfMinutes <> "0" Then
            ' No longer a minute ending with 0 or 5 so turn the bug off
            API.Function("OverlayInput4Out") 
            BugIsOn = false
        End If
    else
        If LastDigitOfMinutes = "5" or LastDigitOfMinutes = "0" Then
            ' Minute now ends with "0" or "5" - Turn the bug on
            API.Function("OverlayInput4In",Input:="<<name of your input goes here>>")
            BugIsOn = true
        End If
    End If
    sleep(1000)  ' Sleep for one second
Loop
 We use overlay 4 for our bug and while you can use the input number instead of the name of your input in your script it's subject to breakage if someone removes a lower numbered input.  Of course if someone renames the input it will also break but I prefer that risk. This script runs as a vMix global script under Settings>Scripting | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,447  Location: BelgiumThanks: 311 timesWas thanked: 1006 time(s) in 830 post(s)
 
 | 
            
		      
                Originally Posted by: Roy Sinclair  
 We use overlay 4 for our bug and while you can use the input number instead of the name of your input in your script it's subject to breakage if someone removes a lower numbered input.  Of course if someone renames the input it will also break but I prefer that risk.
 
 
 one can always use the input's ID number | 
    | 
              1 user thanked doggy for this useful post. |  | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 11/23/2020(UTC) Posts: 217  Location: WichitaThanks: 11 timesWas thanked: 29 time(s) in 25 post(s)
 
 | 
            
		      
                Originally Posted by: doggy  Originally Posted by: Roy Sinclair  
 We use overlay 4 for our bug and while you can use the input number instead of the name of your input in your script it's subject to breakage if someone removes a lower numbered input.  Of course if someone renames the input it will also break but I prefer that risk.
 
 
 one can always use the input's ID number I said that  ;). | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,447  Location: BelgiumThanks: 311 timesWas thanked: 1006 time(s) in 830 post(s)
 
 | 
            
		      
                Originally Posted by: Roy Sinclair  Originally Posted by: doggy  Originally Posted by: Roy Sinclair  
 We use overlay 4 for our bug and while you can use the input number instead of the name of your input in your script it's subject to breakage if someone removes a lower numbered input.  Of course if someone renames the input it will also break but I prefer that risk.
 
 
 one can always use the input's ID number I said that  ;). Nope: Input number and input ID (or key) are 2 different things ;-)   InputKey.JPG (40kb) downloaded 8 time(s). | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 11/23/2020(UTC) Posts: 217  Location: WichitaThanks: 11 timesWas thanked: 29 time(s) in 25 post(s)
 
 | 
            
		      
                Originally Posted by: doggy  Nope: Input number and input ID (or key) are 2 different things ;-)   InputKey.JPG (40kb) downloaded 8 time(s). Oh yeah, that's right.  That's a number that won't change unless the input is deleted and recreated.  Probably should be using that. | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Member
 Groups: Registered
Joined: 1/6/2014(UTC)
 Posts: 15
 
 Thanks: 3 timesWas thanked: 1 time(s) in 1 post(s)
 
 | 
            
		      
                hi doggy, this is my scenario : when an active Inputlist is playing an item on pgm, check the name of the next item (file) and if the name contains "VOT " than do something (anable loop to that active list). please help i am a dummy. | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,447  Location: BelgiumThanks: 311 timesWas thanked: 1006 time(s) in 830 post(s)
 
 | 
            
		      
                Originally Posted by: endiaer   an active Inputlist is playing  What is an "active Inputlist" ? Can we please stick to vMix words, don't feel like having to guess what one means   | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Member
 Groups: Registered
Joined: 1/6/2014(UTC)
 Posts: 15
 
 Thanks: 3 timesWas thanked: 1 time(s) in 1 post(s)
 
 | 
            
		      
                Originally Posted by: doggy  Originally Posted by: endiaer   an active Inputlist is playing  What is an "active Inputlist" ? Can we please stick to vMix words, don't feel like having to guess what one means   Sorry for my poor english. I mean input of video list that is currently playing  | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,447  Location: BelgiumThanks: 311 timesWas thanked: 1006 time(s) in 830 post(s)
 
 | 
            
		      
                Originally Posted by: endiaer  Originally Posted by: doggy  Originally Posted by: endiaer   an active Inputlist is playing  What is an "active Inputlist" ? Can we please stick to vMix words, don't feel like having to guess what one means   Sorry for my poor english. I mean input of video list that is currently playing  Still not sure: either its a Playlist or a List Input Playlist: one can not check the next item in the list , only the current one playing  List : one can pull the list from the API xml and the one that is selected/playing  (so one could theoretically deduct which would be the next one in line)  BUT why not just have  either one (list or playlist)  build properly and have either one just on loop? no testing needed | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Member
 Groups: Registered
 Joined: 8/4/2020(UTC) Posts: 16   Location: MumbaiThanks: 19 timesWas thanked: 4 time(s) in 2 post(s)
 
 | 
            
		      
                Originally Posted by: endiaer  hi doggy, this is my scenario : when an active Inputlist is playing an item on pgm, check the name of the next item (file) and if the name contains "VOT " than do something (anable loop to that active list). please help i am a dummy. Code:dim doc as New System.Xml.Xmldocument
doc.LoadXml(API.XML())
Dim strListName as String = "ListName"
Dim strListID as string = doc.SelectSingleNode("/vmix/inputs/input[@shortTitle='"+ strListName +"']").Attributes("number").Value
Dim strPgmID as string
dim strNextItemName as String
strPgmID = doc.SelectSingleNode("/vmix/active").InnerText
strNextItemName = doc.SelectSingleNode("/vmix/inputs/input[@shortTitle='" & strListName & "']/list/item[@selected=""true""]/following-sibling::item").InnerText
if strPgmID = strListID and strNextItemName.contains("VOT") then
'List LoopOn
else
'List LoopOff
end if
 | 
    | 
              3 users thanked ron2210 for this useful post. |  | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Member
 Groups: Registered
Joined: 1/6/2014(UTC)
 Posts: 15
 
 Thanks: 3 timesWas thanked: 1 time(s) in 1 post(s)
 
 | 
            
		      
                Originally Posted by: ron2210  Originally Posted by: endiaer  hi doggy, this is my scenario : when an active Inputlist is playing an item on pgm, check the name of the next item (file) and if the name contains "VOT " than do something (anable loop to that active list). please help i am a dummy. Code:dim doc as New System.Xml.Xmldocument
doc.LoadXml(API.XML())
Dim strListName as String = "ListName"
Dim strListID as string = doc.SelectSingleNode("/vmix/inputs/input[@shortTitle='"+ strListName +"']").Attributes("number").Value
Dim strPgmID as string
dim strNextItemName as String
strPgmID = doc.SelectSingleNode("/vmix/active").InnerText
strNextItemName = doc.SelectSingleNode("/vmix/inputs/input[@shortTitle='" & strListName & "']/list/item[@selected=""true""]/following-sibling::item").InnerText
if strPgmID = strListID and strNextItemName.contains("VOT") then
'List LoopOn
else
'List LoopOff
end if
 it works, my project of automation has been completed. Thank you Rom2210 and doggy | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Newbie
 Groups: Registered
 Joined: 6/29/2021(UTC) Posts: 3  Location: ManadoThanks: 1 times
 | 
            
		      
                Hello Expert,
 Is it Possible to enable/disable and move among items in list using script since there are no functions available? If yes, please help give some syntax!
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,447  Location: BelgiumThanks: 311 timesWas thanked: 1006 time(s) in 830 post(s)
 
 | 
            
		      
                Originally Posted by: NDI_SRT  Hello Expert,
 Is it Possible to enable/disable and move among items in list using script since there are no functions available? If yes, please help give some syntax!
 Open the list editor and use the mouse to move amongst the items or change the order. Maybe explain a bit better your intentions | 
    | 
              1 user thanked doggy for this useful post. |  | 
    |  | 
        
        
        
    
        
            
            
    | 
	Rank: Newbie
 Groups: Registered
 Joined: 6/29/2021(UTC) Posts: 3  Location: ManadoThanks: 1 times
 | 
            
		      
                Originally Posted by: doggy  From a recent request/discussion to trigger something BEFORE  a video finishes  Code:' Checking time left of active input
' and do some stuff at certain time remaining
dim position as string = ""
dim duration as string = ""
dim activeinput as string = ""
dim Timeleft as double = 0
dim triggertime as integer = 2000       '2 seconds before end
dim triggerduration as integer = 2000   'fade duration, could be different than trigger
do while true
   dim xml as string = API.XML()
   dim x as new system.xml.xmldocument
   x.loadxml(xml)
activeinput = (x.SelectSingleNode("//active").InnerText)
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)
Timeleft= Double.Parse(duration)-Double.Parse(position)
if Timeleft < triggertime  
  API.Function("SetVolumeFade",Input:=activeinput.tostring(),Value:="0," & triggerduration.tostring())
  ' do whatever one wants to do 
end if
sleep(500)
Loop
 Thanks for this script. I will use it for playing list of several items in AutoNext mode. I want the trigger to occur once at the last item with their total duration and not before every item ends. What should be the syntax like? Thank you for help | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
	Rank: Advanced Member
 Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,447  Location: BelgiumThanks: 311 timesWas thanked: 1006 time(s) in 830 post(s)
 
 | 
            
		      
                Originally Posted by: NDI_SRT  Thanks for this script. I will use it for playing list of several items in AutoNext mode.
 
 Why would you need this script if you are playing the list in auto next ? Quote:I want the trigger to occur once at the last item with their total duration and not before every item ends. Again , the mentioned script is not applicable then (some of it's ideas might) Quote: What should be the syntax like?  So you want someone to solve your specific request by writing code for you ? With all due respect I suggest hiring a programmer! Tell the programmer the code needs to check for the last item being played, check when its at the end of its play and then perform the trigger. There are often several different ways to skin a cat. This thread provides little tidbits and ideas to start from and learn. | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
                           
	
    
        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