Copy link to clipboard
Copied
Hi,
I am trying to create a droplet, where i could drop 3 separate pictures and then it would start an action where the three pictures are combined in to a new canvas. The action alone works perfectly, but the trouble is that it starts too soon when i drop the files in to the droplet. I would like it to start when the three pictures are loaded, not when the first one is loaded. Any suggestions how to get this to work?
Copy link to clipboard
Copied
Interesting question! I think all you can do is open 2 pictures in Photoshop first, then drop the last one on the droplet.
I understand how that is very likely to be not what you want but I think it's the best it can do.
Copy link to clipboard
Copied
That does not seem to be what Droplets are there for by a long shot.
But just to make sure could you post a screenshot of the expanded Action in the Actions Panel?
Is there a clear unequivocal between the three images (position, name, …)? If there is a Script might provide a work-around.
Copy link to clipboard
Copied
As @c.pfaffenbichler commented, Batch Actions/Droplet Actions don't work that way. I too would suggest a script to open the three files, then the script could run the action.
Copy link to clipboard
Copied
If the »connected« images can be unequivocally identified I suppose one could record the Script into an Action, create a droplet off of that and drop only one of each »triplet« onto it.
Copy link to clipboard
Copied
Hi,
Sorry for the late response but the file names that i want to combine are usually named in the form of E24152513_1 (1) & E24152513_1 (2). So everything else is constant in one group of pictures but the (1).
The number code between E and _1 differs for every product group so that i know which pictures to combine.
Copy link to clipboard
Copied
What is the file format?
Copy link to clipboard
Copied
They are 99.999% jpeg. I posted for visual representation of files. I have combine from 2-5 pictures depending on the product group.
Copy link to clipboard
Copied
The trousers seem to follow a different naming-convention and there are four jackets, not three.
So what is the actual work-flow supposed to be?
Copy link to clipboard
Copied
// place two files with numbers added to »(1)« in filename;
// 2022, use it at your own risk;
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
var docName = myDocument.name;
var theRegExp = new RegExp (/\(\d{1,3}\)/gi);
try {
var basename = docName.match(/(.*)\.[^\.]+$/)[1];
var docPath = myDocument.path;
var theBrackets = String(basename.match(theRegExp));
var theNumber = theBrackets.match(/\d{1,3}/gi);
for (var m = 1; m <= 2; m++) {
var theOther = docPath+"/"+docName.replace(theRegExp, "("+(Number(theNumber)+m)+")");
if (File(theOther).exists == true) {
placeScaleRotateFile (File(theOther), 0, 0, 100, 100, 0, false)
};
}
}
catch (e) {
var basename = myDocument.name;
var docPath = "~/Desktop"
};
};
////// place //////
function placeScaleRotateFile (file, xOffset, yOffset, theXScale, theYScale, theAngle, linked) {
var idPxl = charIDToTypeID( "#Pxl" );
var idPrc = charIDToTypeID( "#Prc" );
var idPlc = charIDToTypeID( "Plc " );
var desc5 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
desc5.putPath( idnull, new File( file ) );
var idFTcs = charIDToTypeID( "FTcs" );
var idQCSt = charIDToTypeID( "QCSt" );
var idQcsa = charIDToTypeID( "Qcsa" );
desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
var idOfst = charIDToTypeID( "Ofst" );
var desc6 = new ActionDescriptor();
var idHrzn = charIDToTypeID( "Hrzn" );
desc6.putUnitDouble( idHrzn, idPxl, xOffset );
var idVrtc = charIDToTypeID( "Vrtc" );
desc6.putUnitDouble( idVrtc, idPxl, yOffset );
var idOfst = charIDToTypeID( "Ofst" );
desc5.putObject( idOfst, idOfst, desc6 );
var idWdth = charIDToTypeID( "Wdth" );
desc5.putUnitDouble( idWdth, idPrc, theYScale );
var idHght = charIDToTypeID( "Hght" );
desc5.putUnitDouble( idHght, idPrc, theXScale );
var idAngl = charIDToTypeID( "Angl" );
var idAng = charIDToTypeID( "#Ang" );
desc5.putUnitDouble( idAngl, idAng,theAngle );
if (linked == true) {
var idLnkd = charIDToTypeID( "Lnkd" );
desc5.putBoolean( idLnkd, true );
};
executeAction( idPlc, desc5, DialogModes.NO );
// get layerid;
var ref = new ActionReference();
ref.putProperty (stringIDToTypeID ("property"), stringIDToTypeID ("layerID"));
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var layerDesc = executeActionGet(ref);
var layerID = layerDesc.getInteger (stringIDToTypeID ("layerID"));
return layerID;
};