Automatic EXTRUDE and Boolean operations

I'm trying to set up some scripts to automate EXTRUDE and Boolean operations like SUBTRACT.
EXTRUDE seems to be OK, as I can create a shape, then select it using
E.g. to extrude a circle by 20 units:
_CIRCLE 0,0 10 _EXTRUDE Last
20 0
However, if I create two objects (A and B) and I want to subtract B from A, I can still specify B as Last, but how do I identify A (the '2nd Last')?
_SUBTRACT '2nd Last'
I can use 'Crossing' and specify a window to select A, but this is a bit crude. Is there a better way?
Thanks for any info.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
Add image file
Upload is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.