Skip to main content
HugoTW
Participating Frequently
Sep 10, 2018 8:45 AM UTC
Answered

Run script from command line

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.

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 

This topic is closed to new replies. Start a new post to keep the conversation going.
Sunil Yadav
Sunil YadavCorrect answer
Legend
Sep 10, 2018 10:52 AM UTC

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

10 replies

Sunil Yadav
Sunil YadavCorrect answer
Legend
Sep 10, 2018 10:52 AM UTC

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

Translate
HugoTW
HugoTWAuthor
Participating Frequently
Sep 12, 2018 5:51 AM UTC

yadavs92328

Thanks! It works like a charm!

Translate
Sunil Yadav
Legend
Sep 10, 2018 10:00 AM UTC

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.

Translate
Steve Werner
Community Expert
Community Expert
Sep 10, 2018 9:07 AM UTC

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

Translate