Skip to main content
Participant
February 3, 2025
Answered

Evnet for select active project

  • February 3, 2025
  • 1 reply
  • 120 views
💡Hello,

Using ExtendScript, I want to select a notifier (event listener) only when the active Photoshop document changes.
For example:

It should be triggered when switching to a different document (Ctrl+Tab or Window → Select Document) without closing the current document.
However, selection errors should not be triggered when the tool is changed or a new document is opened.
What I've tried so far:
✅ Tried the "Opn" and "Cls" events, but these only work when the document is opened and closed.
✅ "slct" activity is not suitable for intense effort.
✅ I tried "Ntfy", "Dcmn", sometimes it works and sometimes it doesn't seem to work.

Is there a definitive method that only works on document exchange?

Code example:

javascript
copy
To organise
app.notifiersEnabled = true;
var notifierFile = new File($.fileName);
app.notifiers.add("Ntfy", notifierFile, "Dcmn"); // Should work on document exchange
📌 I want to know if this method is reliable or if there is a better approach.
Thanks for your answers people! 🙌
Correct answer c.pfaffenbichler

I think you can add the event in »Script Events Manager.xml«: 

Edit: The event should then be available in Script Events Manager. 

1 reply

c.pfaffenbichler
Community Expert
c.pfaffenbichlerCommunity ExpertCorrect answer
Community Expert
February 3, 2025

I think you can add the event in »Script Events Manager.xml«: 

Edit: The event should then be available in Script Events Manager.