Ответ: Скрипт в Photoshop CS5
Код:
// get document name; duplicate to new document; close;
// name layer in new document using the original document name
var docRef = app.activeDocument;
var docName = docRef.name;
docRef.changeMode(ChangeMode.RGB);
var newLayer = docRef.activeLayer.duplicate(documents[0],ElementPlacement.PLACEATBEGINNING);
[B]app.activeDocument = documents[0];[/B]
var i = docName.lastIndexOf(".");
newLayer.name = i > 0 ? docName.substring(0, i) : docName;
if (docRef !== documents[0]) {
docRef.close(SaveOptions.DONOTSAVECHANGES);
}