How To Set Session Box Start At Selected Track Position
I was asked the following:
I’ve bought Control Surface Studio 3 and been trying to figure out how to make a script so that a Session Box will start/move to whatever track is selected with my mouse in Ableton Live 12. I’m using a Maschine Jam from Native Instruments.
Here’s how to do it:
For the listener use: song > selected track has changed
For the action select: script > set session box position
– Then for Track Number (set it to custom code) add the code: self.get_selected_track_num()
I have attached a script with the above configuration which you can import. I tested it and it works.

The article linked in my answer explains how to attach the session box to the selected track and scene.
This knowledge base article explains how to attach a Session Box to both the selected track & selected Scene
This Works Great unless you have some of your tracks Grouped and those Groups are Collapsed. If you select any Tracks with a Track number Higher than the collapsed Group, the session box jumps by the number of Tracks in the Group.
So when theres 2 Tracks grouped, i can select the group and everything is fine, but if i select the Group after that, the Session Box jumps 2 Tracks further.
Is there a fix for that?

We have tested this and were able to replicate it.
This is being investigated and worked on.
As this also effects a number of other aspects of CSS scripts (highlight navigation, LED feedback and some others). These all need to be addressed at the same time, so it may take a little while to complete.
Thx so much, im workin on a workaround atm, one thing i thought about is using the loop with all Visible tracks instead of all tracks.
Im trying to have one modifier allways scroll through all tracks and count, how many are grouped and collapsed, so then i can use selected track minus the modifier. Maybe somethin like that might help

You can use ‘Track – is collapsed’ in the conditions section to check for grouped tracks.

CSS3.0.2 (released today) fixes the issue of the highlight getting stuck at grouped tracks.
When i press on go to my Downloads it still gives me the installer for CSS3.0.1 (Mac)
Sign up
User registration is currently not allowed.
Thank you so much, it works perfectly. But can you make one where the scene number is also the selected scene number, and not just 0?
And how did you put the track number to custom code instead of number?