Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: How to get event target?

$
0
0

Something like this

 

try {    if (arguments.length >= 2) {        var desc = arguments[0];        var event = arguments[1];        // make sure it's the hide event        if (event == charIDToTypeID('Hd  ')) {            // get the list of what was hidden            var list = desc.getList(charIDToTypeID('null'));            // get the actionReference for what was hidden            var ref = list.getReference(0);            // get it's Photoshop class            var psClass = ref.getDesiredClass();            // make sure it was a layer that was hidded and do something with the layerName            if(psClass == charIDToTypeID('Lyr ')) alert(ref.getName());        }    }
} catch (e) {    alert( "Error: " + e + ":" + e.line );
}

Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>