zingy
zingy

Reputation: 811

Make photoshop run system command through javascript

I have a line of code as below

app.system("cmd.exe python D:\project\PStest.py"); 

This is to run a python script from within photoshop. The similar question is asked here already and I followed the same Use Photoshop JavaScript to Execute System Command Line Prompt

When I execute the above code I get an error as

Error 24: app.system is not a function.

Upvotes: 3

Views: 1057

Answers (1)

Quentin Reyre
Quentin Reyre

Reputation: 11

I got that error while in ExtendedScript tool with the wrong environement.

I never manadge to get the app.system() command to work with:

#target photoshop
app.system( "python  C:\ps_test.py"); 

the cmd window popup and close right away, nothing happens. If you know the right way to write it.

A workaround I found as a beginner.

#target photoshop
var bat = new File("C:/ps_test.bat");
bat.execute();

Upvotes: 1

Related Questions