Help with "Events Manager" scripting
OK. I'm new to using Events Manager and Script Listener so I don't have all the little things down yet.
What I'm trying to do is set up an Events Manager to activate a script when I select a layer. As I have it now, the script activates no matter what I select and I am having trouble limiting it to only activate when I select a layer. The output from ScriptListener was:
var idslct = charIDToTypeID( "slct" );
var desc10 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref19 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
ref19.putName( idLyr, "Face" );
desc10.putReference( idnull, ref19 );
var idMkVs = charIDToTypeID( "MkVs" );
desc10.putBoolean( idMkVs, false );
executeAction( idslct, desc10, DialogModes.NO );
I used slct as the Event Name when creating the new event in the Events Manager. However, this same ID is used when a tool is selected. That isn't a huge problem but for the fact that my whole reason for setting this up is so that when I first select a layer, I want to set up a specific tool preset to use on it. If I then change tools (select another tool) and still have the same layer selected the script will automatically select the initial tool for the layer that is still selected since that layer is still the active layer.
Example: Let's say I have the following layers...
Texture
Heal
Tones
Eyes
Lips
Face
These aren't my normal layers, but as an example when I select the "Heal" layer I would want to start with the healing brush tool. However, sometimes I want to use clone on this layer as well. Using the Event as it is now, Heal would still be the active layer when I make the selection to the clone tool so the script would then change the selected tool back to the healing brush tool.
So, is there any way to limit the selection event ID to only activate when a layer is selected? I notice the line above in bold/red is the Layer event ID. I'm just not sure how to tie this into the Event Manager and/or script.
Thanks for any help.
Mike
