Run script from command line

Community Beginner ,
Sep 10, 2018 Sep 10, 2018

Copy link to clipboard

Copied

Greeting all,

What I am trying to do is to force InDesign to open a jsx file directly. It seems not working either using command line tool or opening jsx file directly. The error message is captured as below image.

Pasted_Image_10_09_2018__4_43_PM.png

Can anyone please advise the best way to trigger a script file from command line? The reason to do so is that the jsx file is generated dynamically by hardware.

Thanks in advance!

Best,

Hugo 

TOPICS
Scripting

Views

4.5K

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

correct answers 1 Correct answer

Adobe Community Professional , Sep 10, 2018 Sep 10, 2018
Try this,This is command line argument,wscript.exe D:\SunilY\Test\vbScript.vbsThis is my vbScript.vbsSet myInDesign = CreateObject("InDesign.Application.CC.2017")dim myArray, myStringmyTestJavaScript = "D:\SunilY\Test\test.jsx"myInDesign.DoScript myJavaScript, 1246973031

Likes

Translate

Translate
Adobe Community Professional ,
Sep 10, 2018 Sep 10, 2018

Copy link to clipboard

Copied

Ask in the InDesign Scripting forum. I'll move your messge there now.

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
Adobe Community Professional ,
Sep 10, 2018 Sep 10, 2018

Copy link to clipboard

Copied

You can't just open .jsx file into indesign application. If you want to execute jsx, you can call jsx from vb script, and call that vbscript from command line.

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
Adobe Community Professional ,
Sep 10, 2018 Sep 10, 2018

Copy link to clipboard

Copied

Try this,

This is command line argument,

wscript.exe D:\SunilY\Test\vbScript.vbs

This is my vbScript.vbs

Set myInDesign = CreateObject("InDesign.Application.CC.2017")

dim myArray, myString

myTestJavaScript = "D:\SunilY\Test\test.jsx"

myInDesign.DoScript myJavaScript, 1246973031

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
Community Beginner ,
Sep 11, 2018 Sep 11, 2018

Copy link to clipboard

Copied

yadavs92328

Thanks! It works like a charm!

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 ,
Jul 15, 2019 Jul 15, 2019

Copy link to clipboard

Copied

Saved my life

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

What is 1246973031 in the VBScript?

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
Guru ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

quote

What is 1246973031 in the VBScript?


By @Sohum21815629kzif

It's enumeration — the 2-nd parameter of the DoScript command — Language: the language of the script to execute.
This number is equivalent to idJavascript.

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
Explorer ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

LATEST

where can we get that  wscript.exe

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