BLOGGER TEMPLATES AND TWITTER BACKGROUNDS »

Monday, May 24, 2010

Swap object names

Okay so I didn't make any handy scripts at work today so I'm sharing one that I have on my custom marking menu. It just simply swaps the name of two objects. Handy if you need to remake a joint chain and don't want to rename them all.

string $s[] = `ls -sl`;
if ($s[0] == "") error "Make a selection!";
else {
string $num1 = $s[0];
string $num2 = $s[1];
rename $num1 ($num1 + "TEMP");
rename $num2 $num1;
rename ($num1 + "TEMP") $num2;
}

0 comments: