Skip to main content
Participating Frequently
June 11, 2018
Answered

CEP ModalDialog Close Event on ''X" Button

  • June 11, 2018
  • 3 replies
  • 2301 views

Hi Everyone,

I have CEP extension(Modal Dialog). I want  close event  when clicked on cross( ''X") Button.

I have tried  this CEP event i.e. "com.adobe.csxs.events.ExtensionUnloaded".

But this solution/event not working for me.

Could anyone please help me on this ??

Thanks,

Yogita

This topic has been closed for replies.
Correct answer Trevor:

Got you now.

On InDesign it's a bit difficult because when you close the extension it just about managers to send out the close signal and is already closed by the time it would be able to pick it up.

What you can do is have in your extension bundle an invisible extension without any title or UI that starts with you main extension and can pickup the main extensions close signal and act on it.

3 replies

Inspiring
November 21, 2023

Hi,
    I want to do the same, I am able to call the function but the panel closes first but I want to close the panel after executing my function- 

(function() {  

  'use strict';  

  var csInterface = new CSInterface();  

  var keepAlive = new CSEvent("com.adobe.InDesignPersistent", "APPLICATION");  

  keepAlive.extensionId = "com.adobe.ImportExport.panel";  

 
  new csInterface.addEventListener("com.adobe.csxs.events.panelWindowVisibilityChanged",

  function(event) {  

    alert('Window Visibility: ' + event.data);  
   
  }
 
  );  
 
}());  
AnatoliyZ
New Participant
October 17, 2019
var csInterface = new CSInterface();

csInterface.addEventListener("com.adobe.csxs.events.WindowVisibilityChanged", function (event) {
});
Trevor:
Brainiac
June 11, 2018

window.__adobe_cep__.closeExtension();

Participating Frequently
June 11, 2018

Hi, Thanks for your reply.

I am aware about  this window.__adobe_cep__.closeExtension(). It closes the Extension automatically.

But my requirement is when i hit close button i want to fire event after dialog is closed.

Something like below code:

$('#dialog').on('dialogclose', function(event) {

     //Code to be executed when close is clicked

});

Thanks,

Yogita

Trevor:
Trevor:Correct answer
Brainiac
June 11, 2018

Got you now.

On InDesign it's a bit difficult because when you close the extension it just about managers to send out the close signal and is already closed by the time it would be able to pick it up.

What you can do is have in your extension bundle an invisible extension without any title or UI that starts with you main extension and can pickup the main extensions close signal and act on it.