Skip to main content
Participant
May 23, 2011
Answered

Exiting photoshop from a jsx script

  • May 23, 2011
  • 2 replies
  • 9006 views

I've written a jsx script which performs a set of automated testing operations for a plugin I'm writing.

The intention is that it spits out a folder full of PNGs that I can then externally examine to make sure its functioning as it should.

The biggest problem I've got now is that I can't find a way in Javascript to quit the Photoshop application when I'm done.

(I know VBS has a quit function, but rewriting my script into VBS isn't really an option, unless there's a way I can run VBS code from within my JSX script?)

This topic has been closed for replies.
Correct answer c.pfaffenbichler

var idquit = charIDToTypeID( "quit" );

executeAction( idquit, undefined, DialogModes.ALL );

2 replies

Inspiring
March 27, 2012

     photoshop.quit();

if you want to keep things simple...

Inspiring
April 5, 2012

Hi,

Is there possible to Start the application or open the application through scripting?

Could you please let me know.

thanks,

rajiv,s

April 5, 2012

Hi rajiv

Check this code.

#target photoshop

app.bringToFront();

- yajiv.

c.pfaffenbichler
Community Expert
c.pfaffenbichlerCommunity ExpertCorrect answer
Community Expert
May 23, 2011

var idquit = charIDToTypeID( "quit" );

executeAction( idquit, undefined, DialogModes.ALL );

Participant
May 23, 2011

Thanks - that's getting me closer to where I need to be :-)

On a related question, is there a way to supress the "You should only run scripts from a trusted source" message box that pops up when you externally launch a .jsx file?

Participant
May 23, 2011

Never mind - just discovered I can run the PS exe directly with my script as an arg and it appears to work fine :-)