Skip to main content
Inspiring
June 22, 2022
Question

Call python script from adobe indesign script (Extended Script)

  • June 22, 2022
  • 3 replies
  • 1389 views

HI,

I have python script which i want execute the script from Adobe indesign Javascript (Extended Script) CC20. It should be in MAC

    This topic has been closed for replies.

    3 replies

    Community Expert
    June 24, 2022

    Here the link to this other thread that is related:

    Run External script from indesign javascript
    $rikanth, Jun 22, 2022

    https://community.adobe.com/t5/indesign-discussions/run-external-script-from-indesign-javascript/td-p/13024180

     

    My question about the Python script's position in the file system is answered.

    You tried to run the script with ExtendScript's file.execute() method when the file is on the desktop.

    In my experience this is analog to a double-click on the file.

     

    So: Does it work with a double-click to execute the file?

    Quoting your code from this other thread:

    var myJavaScriptFile = new File("~/Desktop/websterdict.py");
    myJavaScriptFile.execute();

     

    Regards,
    Uwe Laubender
    ( Adobe Community Professional )

    Community Expert
    June 24, 2022

    Hi $rikanth,

    you asked this also in another thread and gave a code sample.

    I asked some questions there.

     

    Where do you want to execute the ExtendScript code part from?

    Is it the User folder of your Scripts panel in InDesign?

     

    Where is the Python script file positioned in your file system?

    Could you execute it with a double-click?

     

    Regards,
    Uwe Laubender
    ( Adobe Community Professional )

    Community Expert
    June 22, 2022

    Hi @$rikanth,

    You could create a shell script file containing the command to execute your python script and then call this shell script file using the File objects execute method.

    -Manan

    -Manan
    $rikanthAuthor
    Inspiring
    June 24, 2022

    Thanks Manan,

    But i want elxecute from MAC machine!

    Community Expert
    June 24, 2022

    Shell scripts excute on a MAC, what's the problem here?

    -Manan

    -Manan