Extrude by object height

Hi guys, how´s going?
i was thinking of a script that would apply an extrude modifier into a spline, using an object height as the amount. Example, select the spline, run the script, wich asks to pick the reference object, and then apply extrude modifier with the objetc height. Is it possible? too hard to code?
Thanks in advance,

Jsrocha