Skip to main content
Participating Frequently
July 4, 2017
Question

Exit from the photoshop application using javascript or extendscript in Mac OS

  • July 4, 2017
  • 1 reply
  • 812 views

Hi -- I have created a HTML5 panel extension in photoshop. I have a button and in click event I am trying to quit the photoshop application. I have tried the below code and it is working in windows os but not working in Mac. How can I quit the photoshop application in Mac. Thanks.

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

This topic has been closed for replies.

1 reply

Geppetto Luis
Legend
July 4, 2017

Try with this

ErrStrs = {}; ErrStrs.USER_CANCELLED=localize("$$$/ScriptingSupport/Error/UserCancelled=User cancelled the operation");

try {var idquit = charIDToTypeID( 'quit' ); executeAction( idquit, undefined, DialogModes.ALL ); }

catch(e){if (e.toString().indexOf(ErrStrs.USER_CANCELLED)!=-1) {;}

    else{alert(localize("$$$/ScriptingSupport/Error/CommandNotAvailable=The command is currently not available"));}}

Participating Frequently
July 4, 2017

Hi -- I have tried the below code and It closes the Photoshop application but I still see that in Mac Dock (app open state). Any thoughts how to quit the application completely? Thanks.

var idquit = charIDToTypeID( 'quit' ); executeAction( idquit, undefined, DialogModes.ALL );

Geppetto Luis
Legend
July 4, 2017

Use mac

And closes also in doc.