Forum Discussion
Storyline 360 - Can I get access to a Scene Title variable?
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.
I'm not good with javascript yet. What goes before the .query and .parent stuff? Like what do I replace the "?" with?
- Nedim2 hours agoCommunity 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.