Skip to main content
Participating Frequently
July 27, 2009
Question

Exit on finish

  • July 27, 2009
  • 1 reply
  • 3236 views

I'm trying to get a script to execute as a droplet.  At the end I would like Photoshop to exit.  So I took a look at the listener and it gave me

var idCls = charIDToTypeID( "Cls " );
executeAction( idCls, undefined, DialogModes.NO );

So I put that in...but when it executes it gives me.  'the command "Close" is not currently available".  Any ideas?

This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
July 27, 2009

This should close Photoshop..


executeAction(app.charIDToTypeID('quit'), new ActionDescriptor(), DialogModes.NO);

Lehm2000Author
Participating Frequently
July 27, 2009

hmm...okay that worked.  Except the droplet returns exit code 1 when doing that.  exit code 1 typically indicates the app crashed or something.  See I'm launching it from another app that looks at the exit code...if it failed it will try again.  So my droplet is executing over and over again despite it working the way I want.  The only thing I can figure is the 'quit' command is terminating Photoshop rather than doing a proper exit.  Thats a complete guess of coarse I don't know what the quit command does internally.   Is there any other way to exit the application?

Inspiring
July 27, 2009

You could try a action where you insert a menuItem for File-Exit. Perhaps that will create the correct exit code.