I would like to be able to use MEL to discover the names of some animation curves connected to some selected geometry, so that I can write a script to connect the animation of each selected piece of geometry to another node attribute.
something like:
string $mySelection[] = `ls -sl`;
string $myCurve = `"the curve connected to" $mySelection[0] + ".ty"`;
this would hopefully return the name of the animation curve connected to $mySelection[0].ty. So of course I made up the ""the curve connected to" $mySelection[0] + ".ty"" part, because this is my question, how to write that code.
below is an image of the geometry and the animation curve.

THANKS!!!