Forum Discussion

lorraineS's avatar
lorraineS
Community Member
1 day ago

Storyline 360 - Can I get access to a Scene Title variable?

For many reasons, having the scene title variable exposed to developers as a built in variable would be great! Has that happened yet?

 

If no, does anyone know a clean way to get it via javascript?

 

Thanks,

 Lori

3 Replies

  • Nedim's avatar
    Nedim
    Community Member

    There is no built-in Scene Title variable. However, you can retrieve the scene title with JavaScript.

    Create a custom text variable named "SceneTitle" and add an Execute JavaScript trigger to the Slide Master when the timeline starts. Use the following script to get the current scene title and save it to the variable.

    const sceneTitle = document
      .querySelector("#sidebar-panels .cs-selected")
      ?.parentNode?.parentNode?.parentNode
      ?.querySelector(".cs-listitem span:nth-of-type(2)")
      ?.innerText;
    
    setVar("SceneTitle", sceneTitle);

    If this works for you as it did for me, please consider clicking the "Mark as Solution" button on my reply.

    • lorraineS's avatar
      lorraineS
      Community Member

      I'm not good with javascript yet. What goes before the .query and .parent stuff? Like what do I replace the "?" with?

      • Nedim's avatar
        Nedim
        Community Member

        No need to replace "?". The ?. symbol in JavaScript is called optional chaining. It tells the script to continue only when something exists. If something is missing, it returns nothing instead of causing an error. 

        Just use the script as it is, and make sure you reference your custom "SceneTitle" variable on the slides.