You can use Save Text File and use a .jsl extension.
script = "// here's some JSL\!rShow(\!"Hello, World!\!");"; Save Text File( "$desktop\MyScript.jsl", script );
You can also use the JSL Quote function to make creating a string of JSL code a little easier.
script = JSL Quote( // here's some JSL Show("Hello, World!"); ); Save Text File( "$desktop\MyScript.jsl", script );
You could also use the square-bracket quote mechanism, and then open the result in a script editor window. Note the backslash and the open or close square bracket are not part of the saved text, and the embedded quotes need no escaping.
filename = Save Text File( "$temp/DeleteMe.JSL", // this is the opening square-bracket quote "\[ // comment 1 write("these quotes need no special treatment and the newline works too "); // comment 2 //comment 3 ]\" // this is the closing square-bracket quote ); editor = Open( filename, "script" ); // "script" might be needed if the extension is missing
That's an artifact of the forum. It tries to use syntax coloring, but it doesn't parse JSL perfectly. So what is one string, and hence one color, in JMP confuses the parser here.