Skip to main content
raxby
Inspiring
March 6, 2018
Answered

How to choose the right eventClass with notifiers?

  • March 6, 2018
  • 2 replies
  • 1981 views

app.notifiersEnabled = true;

app.notifiers.add("Mk  ", new File("~/Documents/event.jsx"), "HdAl");

This is an event that I added, but it did not work when I started adding the hideAll mask.The eventFile is selected the brush tool ,There are many eventClass of this event,Is my choice of eventClass wrong?

This topic has been closed for replies.
Correct answer r-bin

app.notifiersEnabled = true; 

app.notifiers.add("Mk  ", new File("~/Documents/event.jsx"), "Chnl"); 

// event.jsx

if (arguments[0].hasKey(charIDToTypeID("Usng")))

    {

    if (arguments[0].getEnumerationValue(charIDToTypeID("Usng")) == charIDToTypeID("HdAl"))

        {

        alert("Bingo!");

        // your main code here

        }

    }

2 replies

r-binCorrect answer
Legend
March 6, 2018

app.notifiersEnabled = true; 

app.notifiers.add("Mk  ", new File("~/Documents/event.jsx"), "Chnl"); 

// event.jsx

if (arguments[0].hasKey(charIDToTypeID("Usng")))

    {

    if (arguments[0].getEnumerationValue(charIDToTypeID("Usng")) == charIDToTypeID("HdAl"))

        {

        alert("Bingo!");

        // your main code here

        }

    }

raxby
raxbyAuthor
Inspiring
March 7, 2018

Thank you very much, your idea is very good!

Kukurykus
Legend
March 6, 2018

Wired, first time I was notified of somone's fresh topic though I had no any posts in and wasn't mentioned 😕😕

Now I'm going to sleep so I can't help, however I may give links to only 2 scripts I wrote that use notifiers.

I didn't do anything with notifiers from that time at all, anyway maybe that will be helpful:

Brush Rename Event  and Getting the name of the current brush preset

raxby
raxbyAuthor
Inspiring
March 7, 2018

Thanks for your reply, it will help me, but r-bit's replay may be more concise.

Kukurykus
Legend
March 7, 2018

No problem, I believed he come and give you good answer, but just in case he didn't you got some tips