attachSurface (please help)

I am writing a simple script to attach surfaces, rebuild, and delete history. When I attach using the menu set, and choose not to keep originals all is well. When I take the mel script from that it looks like:

attachSurface -ch 0 -rpo 1 -kmk 1 -m 1 -bb 0.5 -bki 0 -p 0.1;

and when I execute the script as MEL it does not delete originals. I am using Maya 5.0 Can anyone help. Thanks.

If you turn on echo all comands in the script editor many other functions are executed but for your purposes all you need to do is to store the original selction of the two surfaces being attached and then delete them after the attach command.