Change motion using script in Unity Editor

Hi how do we change motion in an AnimatorController using script in Unity Editor?

The red highlight is the one I’d like to change, but using script

This can be achieved through AnimatorController class within UnityEditor.Animations namespace

It’s solved here animation - Change motion using script in Unity Editor - Stack Overflow