PDA

View Full Version : need help with script



Hervé
11-19-2004, 09:23 AM
Diver made a script yesterday for changing the duplicated FX-Linker Null based on X Distance to object.... I've changed the null name to myItem ($self), I edited the script in a text editor, replaced manually the fles input/output adresses, then I run the script... and I receive a error file input message.... any views on this...

Thanks
here is the script

@script generic
@version 2.5
@name IL_LWSEnum

generic
{

// The refnull name: myItem ($self)

// ParamName "X Distance to Object"
// ItemName "myItem ($self)"

// Edit this:
myItem="myItem";
lwsIn=File("F:\\Delft_Chinese_Style\scenes\scene_v006.lws", "r") || error("Input File Error");
lwsOut=File("F:\\Delft_Chinese_Style\scenes\scene_v007.lws", "w") || error("Output File Error");
// ------------------------------------------------------------------------

num=1;
while(!lwsIn.eof())
{
line=lwsIn.read();
if(line==" ParamName \"X Distance to Object\"")
{
lwsOut.writeln(line);
line=lwsIn.read();

lwsOut.writeln(string(" ItemName \"", myItem, " (", num, ")", "\""));
num++;
}
else
lwsOut.writeln(line);
}
lwsIn.close();
lwsOut.close();
}