real time trajectory spline

Hello.can somebody write a max script that give me a spline that is an instance copy from trajectory , for example with changing of trajectory that spline transform to trajectory in real time.
I really need it. thanks a lot.