Get total amount of scenes number

I know how to get individual scene name/number, but is there a way through javascript to get the total number of scenes?

I currently have this code:
var scenenumber = hypeDocument.currentSceneName();

if {
hypeDocument.getSymbolInstanceById(‘sceneNameSymbol1’).element().children[0].children[0].innerHTML = scenenumber.concat(’/17’); // change total slide number

Of the top of my head.

	var currentSceneName = hypeDocument.currentSceneName();
var sceneNameArray = hypeDocument.sceneNames();

var sceneNumber = sceneNameArray.indexOf(currentSceneName) + 1;
 hypeDocument.getSymbolInstanceById('sceneNameSymbol1').element().children[0].children[0].innerHTML = sceneNumber + "/" + sceneNameArray.length; // change total slide number

Another way:

var numberofscenes = hypeDocument.sceneNames().length

This requires that each scene name is unique.

Awesome! Thanks @MarkHunte and @Daniel

Also have a look at

I’ve made a demo of what I have so far, and have a new dilemma. I have certain scenes that I don’t want included in the total scene number. Basically, I only want the scenes strictly with numbers to be counted. Is there a way to use RegExp?

total scene (74.7 KB)

Maybe something like

var numberofscenes = hypeDocument.sceneNames(); 

 var sceneNumbers =[];

for (i = 0; i < numberofscenes.length; i++) { 
 var hasLetters = numberofscenes[i].match(/\D/g);
  if (!hasLetters){

By the way check out the new hypeDocument.sceneInfo Extension

Thanks @MarkHunte. I added this to get the last number in that array.

var finalSceneNumber = sceneNumbers.slice(-1)[0]

Here is my updated sample:
total scene number (81.7 KB)