Can I redirect the stdout and stderr pipes to a file?

New Here ,
Sep 01, 2006 Sep 01, 2006

Copy link to clipboard

Copied

Hi, All,

Glad to find that there is a specific forum to discuss InDesign Server.

I'm wondering how to redirect the stdout and stderr pipes of InDesign Server to a file. Any ideas?

Thanks very much.

Nicole
TOPICS
Server developers

Views

623

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2006 Sep 01, 2006

Copy link to clipboard

Copied

Hi Nicole,

If you're starting the server at the command line you can redirect the output to a file by doing this:

indesignserver.com > output.txt

On the Mac side you can redirect stdout and stderr separately:

(indesignserver > output.txt) >& error.txt

Oh, and it's also possible to get at some of the information from a script, there's an errorListErrors (JS: app.errorListErrors.item(i).listErrorMessage)

Paul

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 07, 2006 Sep 07, 2006

Copy link to clipboard

Copied

Thanks Paul.

I want to handle errors in javascript, but my script always terminates when meeting errors. How can I catch errors in script without stoping it? Any tips? Thank you very much.

Nicole

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 25, 2021 Dec 25, 2021

Copy link to clipboard

Copied

LATEST

Thanks for sharing this, it helped my project in js well.

The only for catching the error is latest library.

https://techgearbox.com

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 26, 2006 Sep 26, 2006

Copy link to clipboard

Copied

You should be able to use try...catch blocks where you expect errors and know how to handle them and continue on. This should work just as is does for running JavaScripts against the desktop product.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines