Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 88739

Re: To get the original layer which was duplicated in Photoshop.

$
0
0

I think there are two ways:

1.Compare layer names,the duplicated  has ‘copy’

QQ截图20190823164226.png

 

2.Compare the histograms of the two layers

set other layers  no visible,get current layer  histograms,as follow,if two layers value is same,then get layerID ,the new Layer LayerID greater than old layer LayerID ,so "Layer 1 copy" from" Layer 1"

 

        var r = new ActionReference();          var d = new ActionDescriptor();  
r.putEnumerated(stringIDToTypeID("channel"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));          d.putReference(charIDToTypeID('null'), r);          var options = executeAction(charIDToTypeID( "getd" ), d, DialogModes.NO);      options=options.getList(stringIDToTypeID("histogram"));        var val="";        for (var i = 0; i < options.count; i++)              {                  var  valtemp= options.getInteger(i);                 val=val+"\n"+valtemp;              }          alert(val)

 

the same histograms :

QQ截图20190823165919.png

the different  histograms :

QQ截图20190823170056.png


Viewing all articles
Browse latest Browse all 88739

Trending Articles



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