It sounds like you want to process pairs of jpeg files a create a third image png file. Where first jpeg is the content for the png and the second jpeg is the layer mask for the layer's transparency. That process would require Photoshop scripting and action can not do a process like that.
yes, that's exactly what i want, any resource/sample for the script?
i got try action just now, it really cant make it.
You may find a script or two you could modify to do your process.
any simple way to create a layer mask for a layer and paste a image to layer mask?
here is my try.
var sourceFolder1 = Folder("d:\P")
var fileList1 = sourceFolder1.getFiles();
var sourceFolder2 = Folder("d:\P2")
var fileList2 = sourceFolder2.getFiles();
for (var i=0; i<fileList1.length; i++)
if(fileList1[i] instanceof File)
var docRef1 = open(fileList1[i]);
var layerRef1 = docRef1.artLayers.add();
if(fileList2[i] instanceof File)
var docRef2 = open(fileList2[i]);
app.activeDocument = docRef1;
let say filelist1 is "tree01.jpg " my source image, filelist2 is "tree01_a.jpg", my alpha image, now i only can copy tree01_a.jpg to my tree01.jpg as new layer, but i want copy tree01_a.jpg as a mask for tree01.jpg.