Automatically rename animation tracks and lock them

Hello everybody

I would need a python script that automatically rename all the animation tracks applied on objects in a Blender file (for example applying the name “Scale” to all of them), and lock them.
See screenshot attached.
Does anyone know how to do it?

Many thanks in advance!

Should be something like this: (tested in Blender 3.1)

import bpy

obj_tracks = [o.animation_data.nla_tracks for o in if o.animation_data and o.animation_data.nla_tracks]

for tracks in obj_tracks:
    # in case multiple tracks for an object
    for track in tracks: = 'Scale'
        track.lock = True

Thank you! Perfectly working!
You are a hero :grinning: