ScriptSpot

Forum topic · General Scripting

I gave up...

By mindofbrilliance · 2012-05-20

Description

so simple, and yet nobody in the universe ever thought of making a script to do this... see the picture.

http://i.imgur.com/UBmuq.jpg

the last numbers are exactly the same as their counter position the only different thing is the 3 letters at the beginning. I tried with arrays, no luck, someone please help me I will die.

clearlistener()
allObjects = $*Ptr*
goObjects = $*Chr*
for i = 1 to allObjects.count do
(
select allObjects[i]
$.parent = goObjects[i]
)

Comments (4)

Another way

barigazy · 2012-05-20


clearlistener()
allObjects = sort (for p in $GCF* collect p.name)
goObjects = sort (for c in $ABG* collect c.name)
if allObjects.count == goObjects.count do
(
for i in 1 to allObjects.count do in (getnodebyname goObjects[i]) (getnodebyname allObjects[i])
)

barigazy · 2012-05-20

You are so close, but...:).Cheers for the bear!

mindofbrilliance · 2012-05-20

OMG U SAVED MY LIFE MAN !!! THANKS I OWE YOU A BEAR !!!

Try this one

barigazy · 2012-05-20


clearlistener()
allObjects = sort (for p in $GCF* collect p.name)
goObjects = sort (for c in $ABG* collect c.name)
if allObjects.count == goObjects.count do
(
for i in 1 to allObjects.count do (getnodebyname goObjects[i]).parent = getnodebyname allObjects[i]
)