User Input to select objects in scene - help please

Preamble - I was asked to assist a student to animate a set of stairs flying in from left and right, ascending into the sky - there are eight hundred stairs.

Stair build - easy, even for the student to do manually and if built properly using the Array tool it takes care of naming issues.
I could write the script using specified names - Stair_L_001, Stair_R_001, etc

I began to try and add an edittext field so that a user could specify the object names rather than be restricted to a particular naming convention and got into a tangle.


I'm currently using - myObjsL = for p in $Zip_L_* collect (p) - to collect the objects in the scene

I added - edittext prefix_myObjsL "Name prefix Left: " fieldWidth:50 text: "Zip_L_" - to the rollout...

But if I try to use - myObjsL = for p in $prefix_myObjsL* collect (p) - or - myObjsL = for p in $prefix_myObjsL.text* collect (p) - it bombs.

Here's my script (be it ever so humble) ...

rollout RLT_TheZipper "Zip Two Sides Into The Centre"
group "Intro"
label lab1 "This will Zip multiple objects together along"
label lab2 "the X-Axis to X=0."
label lab3 "No keys - Objects at X=0"
-- label lab4 "STRICT NAMING CONVENTION" -- hangover from old version
-- label lab5 "Zip_L_ - Zip_R_" -- hangover from old version


group "Set Up"

spinner SP_Start_Frame "What Frame Does Zipper Start On?" range:[1,1000,1] type:#integer align:#left fieldwidth:35
spinner SP_Duration "What Frame Does Zipper Stop On?" range:[1,1100,10] type:#integer align:#left fieldwidth:25
spinner SP_Offset "How Long Between Items?" range:[1,20,1] type:#integer align:#left fieldwidth:30
spinner SP_Wide "How Distant from X=0?" range:[1,1000,500] type:#integer align:#left fieldwidth:35
edittext prefix_myObjsL "Name prefix Left: " fieldWidth:50 text: "Zip_L_"
edittext prefix_myObjsR "Name prefix Right:" fieldWidth:50 text: "Zip_R_"

button BTN_Zipper "Zip Them Together"

on BTN_Zipper pressed do

theOffsetL = -1
theOffsetR = (theOffsetL + SP_Offset.value)

myObjsL = for p in $Zip_L_* collect (p)

for p in myObjsL do
addnewkey p.pos.controller (SP_Duration.value - SP_Offset.value)
at time (SP_Start_Frame.value - SP_Offset.value) animate on p.pos.x= -SP_Wide.value
moveKeys p (theOffsetL += (2*SP_Offset.value))

myObjsR = for o in $Zip_R* collect (o)
for o in myObjsR do
addnewkey o.pos.controller (SP_Duration.value - SP_Offset.value)
at time (SP_Start_Frame.value - SP_Offset.value) animate on o.pos.x= SP_Wide.value
moveKeys o (theOffsetR += (2*SP_Offset.value))


createDialog RLT_TheZipper width:250 height:300

Does that make sense? Or have I slipped a cog.