Graphics

 View Only
  • 1.  Scripting Text from one place to another

    Posted 05-23-2014 00:47
    I have a scripting question regarding text. I currently have a lower third scene with what we call "Franchise Tabs." These are essentially a 3rd line of text over a background that aren't always visible. For example, if we have Breaking News we use the Breaking News Franchise tab, which puts Breaking News above the lower third.

    Anyway, my scene currently has a text layer for each franchise tab available, and when the producer puts a character or characters into a field it shows the corresponding text layer. So, for Breaking News, the producer puts "br" in a published text field.

    My goal is to eliminate all the text layers in the scene, and streamline the script so the graphic might run more smoothly.

    So, I want to write a script that essentially makes a non-published text field a certain string of text if the producer puts a certain "shortcut" into the published text field.

    This is what I have so far, but it isn't working:

    ===============================================

    dim franchisetext as xpTextObject

    dim franchise as xpTextObject

    dim br as xpTextObject

    self.GetObjectByName("Franchise Tab", franchisetext)

    self.GetObjectByName("Franchise Text", franchise)

    if franchisetext.text="br" then franchise.text="Breaking News"

    ================================================

    Essentially, the Franchise Tab object is where the producer puts the shortcut. The Franchise Text object is where I want to return the longer version.

    Any help is greatly appreciated.


  • 2.  RE: Scripting Text from one place to another

    Posted 05-23-2014 00:52

    I pasted your script into a new scene in the OnOnline and OnPreviewRender scripts.

    I created two text objects "Franchise Tab" and "Franchise Text". I unpublished "Franchise Text".

    Your script worked fine for me..

    One thing to make sure is that you don't have any other objects, like a group object, that might have the same name as one of the two text objects. That is sure to make the script fail..

    Also, you don't need the "dim br as xpTextObject" line; since you don't use that variable anywhere in the script you can delete that line.

    For safety sake you may want to use something like this instead:

    if Trim(UCase(franchisetext.text))=”BR” then franchise.text=”Breaking News”

    Then it will work with any case (upper or lower) and even if they have a space before or after the "br".


    #XPression


  • 3.  RE: Scripting Text from one place to another

    Posted 05-23-2014 01:01
    Thank you... I was putting the script in the wrong place... I had it on the text layer itself.

    Thank you so much! Easy fix!

    #XPression