Hello,
I'm currently working on an illustrator script in which i need to run a separate python script with parameters.
I'm creating a .bat file in the same folder as the .py script, if i double click this bat file it runs the python script as normal, but if the jsx tries to execute it, it sais it cannot find the .py file.
Here is me code:
var scriptFile = new File($.fileName);
var scriptPath = scriptFile.parent; // leads to /c/projects/TechArt/adobe/illustrator/Illustrator_preview_script
var myScriptPath = File(app.activeScript);
var myScriptName = myScriptPath.fullName; // Leads to /c/Program Files/Adobe/Adobe Illustrator CC 2017/Support Files/Content/Windows/tmp000000001
var os = $.os;
if (os.indexOf("Windows") >=0)
{
var batPath = scriptPath + "/runPyScript.bat";
var runFile = File(batPath);
if (!runFile.exists)
{
runFile = new File(batPath); // Create the bat file
}
runFile.encoding = "UTF-8";
runFile.lineFeed = "Windows";
runFile.open("w");
runFile.write("python thumbnail_shortcut_illustrator.py " + folderPath + "\npause"); // write to the bat file
runFile.close();
runFile.execute(); // execute the bat file
This is the result if i run the .jsx script:

And this is the result if i double click the bat file:

Am confusion