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

Re: Selecting active file when other files are open in PS.

$
0
0

#target photoshop

function main(){

if(documents.length != 1) return;

// Open psd with the layers to copy

//Amend filename to suit

var PSD = new File("/Users/Avaris/Desktop/Current Project/!Memory Mates/HV/mm.psd");

if(!PSD.exists) return;

open(PSD);

selectAllLayers();

activeDocument.activeLayer.duplicate(documents[0]);

app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

}

function selectAllLayers() {

    var desc29 = new ActionDescriptor();

        var ref23 = new ActionReference();

        ref23.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );

    desc29.putReference( charIDToTypeID('null'), ref23 );

    executeAction( stringIDToTypeID('selectAllLayers'), desc29, DialogModes.NO );

}

main();


Viewing all articles
Browse latest Browse all 92406

Trending Articles



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