Beginners question

--animation a slice plane of a slice modifier in time on selected objects
for i = 1 to selection.count do
(local sliceMod = sliceModifier Slice_Type:2
local capMod = Cap_holes ()
addModifier selection[i] sliceMod
addModifier selection[i] capMod
with animate on
( if selection[i].name=="b0" + 1 as string
do (
at time (1+ (i*2)) sliceMod.Slice_Plane.pos = [0,0,0]
at time ((i*5) + 2) sliceMod.Slice_Plane.pos = [0,0,25])
)
)

--- im not able to step the selection as per name