C
HAPTER
4: Action Manager
Using ScriptListener to find event IDs and class IDs
83
6.
The
executeAction
method for both of these actions takes an argument whose value is defined as
"Mk "
. (See
id17
and
id34
.) This is the event ID for the “New” action. This action also needs to know
what class to use, the class ID for the event.
7.
The
putObject
method identifies the class the action operates on. The second argument to
putObject
provides us with the class ID that we need. In the first action,
id33
is defined as
"Dcmn"
, in
the second action,
id45
is defined as
"Chnl"
. These provide our class IDs for Document and Channel,
respectively.
8.
You can now use these event and class IDs to set up event notification on the New Document and
New Channel events from your scripts. In JavaScript, for example:
var eventFile = new File(app.path +
"/Presets/Scripts/Event Scripts Only/Welcome.jsx")
app.notifiers.add("Mk ", eventFile, "Dcmn")
app.notifiers.add("Mk ", eventFile, "Chnl")