Query about project script

Hey Leo,

You helped me out a while ago with a project script that automatically makes sure the current section of the song is visible (not matter which “page” of sections it’s on). That’s been working fantastic for a long time now, but I’ve just run into an issue recently.

I remember this previously working, but could just be my clouded memory.
At the moment the script works perfect when a song is playing, but if I stop a song and it’s on the 2nd page of sections, when I click onto another song, it stays on the 2nd page of sections instead of automatically switching back to the first page.

Attached is a video showing you what I’m talking about.

Hey @Adam_Molinaro, could you post your project script again? I’ll check how to fix it then :slight_smile:

// This ensures that the current section is

// always visible in the canvas section jump buttons

onOscChange(“/setlist/activeSectionIndex”, ([index]) => {

if (index !== undefined) {

const sectionOffset = Math.floor(index / 15) * 15;

setShared(“sectionOffset”, sectionOffset);

}

}, true);

This is it :smiling_face: