script only plays once

Hi i am trying to make this script repeat until all the grouped objects are gone
but it only plays once. so out of 5 groups only 1 gets deleted.

For example if I have 5 groups in the scene I would like this to repeat the script 5 times.

rollout image_button_test "Image Button"
(
------------------------------------------
button theButton "Delete All" width:90 height:20
------------------------------------------

on theButton pressed do
(
for OBJ in helpers do
(
select OBJ
(
print "Start"
for i in selection do i.name = i.name + ("R")
$.renderable = on
delete$
print "Finish"
)
)
)
)
createDialog image_button_test 210 210

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

What is the purpose of this script?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.