Solved / edge to curve in 2.49

it worked the first time so when i selected the object it was already a curve!
and gave an error !

i tried to convert a circle with removing one segment and then use the mesh to curve but it did not recognise the selected object in 2.49

how do you use this script ?

any equivalent in 2.5

Thanks