$.write() and $.writeln() both write line-end character to console?
Copy link to clipboard
Copied
This may seem like a small thing, but I'm finding it really annoying.
Using the ExtendScript Toolkit in CS4 InDesign on Mac OS X 10.4 (Tiger) to write messages to the JavaScript console, I find that both $.write() and $.writeln() will write a line-end after the string passed in. This seems to be broken re. the docs (page 213 of "JavaScript Tools Guide CS4", available from the Help menu, which describes both calls and only mentions linefeeds for the latter).
Are other people seeing this behavior? Is there a way to fix it, perhaps some property or preference on the JavaScript editor/debugger?
Thanks for any help you can offer.
Steve Caine
Copy link to clipboard
Copied
I can certainly reproduce it easily enough. This:
$.write("This");
$.write(" is");
$.write(" a");
$.write(" test.");
produced:
This
is
a
test.
The only workaround (it seems to me) is to build the string in the script and then post it all at once. I confess that I hadn't even realized there was a $.write() function although it ought not to take a rocket scientist to realize that there is.
Copy link to clipboard
Copied
Yes, that's what I've been doing. But I was hoping there was some way to get the correct behavior -- a preference somewhere, or a property on the $ system object. All my debug-log functions, or at least those that write more than one piece of data per line, have to return strings instead of being able to write to the console directly.
Thanks for your reply, Dave.
Steve Caine

