What I do in a case like that is to have each line be it's own string. You will need to escape (as \") all quotes in your script.
Let's say I have this script:
for (var i=0; i<5; i++) {
console.println("The current value of i is " + i);
}
To assign that to an action, I would create a new string variable consisting of concatenations of the individual lines plus a newline character:
var script = "for (var i=0; i<5; i++) {\n" +
"console.println(\"The current value of i is \" + i);\n" +
"}\n";
You can now use that variable in creating your action.
Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com