Graphics

 View Only
  • 1.  VBscript conditions

    Posted 01-05-2021 19:14

    I need some help. I'm trying to add a condition to a script (from @bford) I've used for years successfully. The change would make a single TakeItem fire one of two (or more) TakeItems depending up on time of day. 

    The original script is:

    'Dim MySequencer as xpSequencer = nothing
    'MySequencer = Engine.Sequencer
    'Dim MyTakeItem as xpTakeItem = nothing
    'MySequencer.GetTakeItemByID(12, MyTakeItem)
    'MyTakeItem.Execute()

    My added condition attempt is:

    Dim Report as xpTextObject
    Dim MySequencer as xpSequencer = nothing
    MySequencer = Engine.Sequencer
    Dim MyTakeItem as xpTakeItem = nothing
    If Report.text = "Four"
    MySequencer.GetTakeItemByID(2001, MyTakeItem)
    MyTakeItem.Execute()
    End if
    If Report.text = "FourThirty"
    MySequencer.GetTakeItemByID(2002, MyTakeItem)
    MyTakeItem.Execute()
    End if

    Thanks in advance,

    James.



  • 2.  RE: VBscript conditions

    Posted 01-13-2021 13:31

    You don't make any calls to get the text object itself. 

    Here's an example of something I was just making to pause and continue a video material. 

    ''''''

    dim playmode, res as xptextobject
    dim scene as xpscene
    dim fb as xpOutputFramebuffer

    Engine.GetOutputFramebuffer (0, fb)
    fb.GetSceneOnLayer(0, scene)

    Scene.GetObjectByName("PLAYMODE", playmode)
    Scene.GetObjectByName("RESUME", res)

    playmode.text = “0”

    Dim tmp As Integer
    tmp = res.text

    If tmp = “0” then
    playmode.text = “1”
    End if

    If tmp = “1” then
    playmode.text = “0”
    End if

    res.Text = playmode.Text

     

    ''''''''''

    Does this make more sense, you need to get the text objects from somewhere, in this case, the scene in order to be able to check what they say or set what they say. 


    #XPression