• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Export multi mockup :(

Community Beginner ,
Dec 26, 2021 Dec 26, 2021

Copy link to clipboard

Copied

Hi. I have a problem and I hope I can find help. I have a psd file and in this pds file there are 2 separate mockups on 2 separate artboards. Since these mockups are copies, they can take images from the same smartobject. My problem is: I have several hundred posters and I want to export them in bulk as 2 jpegs. My posters are saved as png. It's inside a folder. It will take my poster from this folder and save it as 2 separate jpegs in a folder. Actually, that's all I need. I think I need to write code but I don't have much knowledge. They wrote a little on the forums, but frankly, I couldn't understand it with my insufficient knowledge 😞 Thank you in advance for your help.

 

,,Untitled-21.jpg

Untitled-2.jpg

TOPICS
Windows

Views

413

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Beginner ,
Dec 26, 2021 Dec 26, 2021

Copy link to clipboard

Copied

By the way, without forgetting, all my posters in png form fit perfectly into the smart object.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

Hi @Lukadris ,

 

Awesome images.

 

  1.  You can use generator in Photoshop. Here's a resource: https://helpx.adobe.com/photoshop/using/generate-assets-layers.html 
  2. You can use the Image Processor command. https://helpx.adobe.com/photoshop/using/processing-batch-files.html
  3. You can record a simple action. Here's a resource: https://helpx.adobe.com/photoshop/using/creating-actions.html

 

Let us know how you go.

mj

 

 

mj_0-1640593952993.png mj_1-1640593953350.png

 

Mohammed Jogie | iMSD.co.za |
Adobe Certified Associate |  Expert | Instructor |
Adobe Community Professional | Creative Ambassador | User Group Manager |
Member International Society of Typographic Designers | Lifetime Friend International Council of Design | Interaction Design Association Local Leader |
Member Pan Afrikan Design Institute | Ambassador Visual Arts Network South Africa | Central Executive Committee Member Printing SA |

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

Hi.

Thank you sir for your help but i need a solution directly. Unfortunately, I am not expert enough to implement the solutions you mentioned 😞
If you have such a code, can you share it with me?

 

Thnx

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

Using artboards may complicate this, some premade solutions that are not designed around artboards may require you to split the artboard file into two separate files and remove the artboard so that you are processing two separate, simpler templates.

 

One option can be found here:

 

http://www.mouseprints.net/old/dpr/PhotoCollageToolkit.html

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2021 Dec 27, 2021

Copy link to clipboard

Copied

You lack knowledge.  To automate a Photoshop process you need to know how Photoshop works well and you need to learn how use Photoshop Automation. Actions and Scripting.   You have creative a complex mockup design can not be automatically populated using Photoshop Action for Actions can not use programming logic that is needed to do the complex processing required to process your merged mockups artboards.

 

If you search the web I do not think you will find any downloadible mocks up template that is designed with multiple Artboards and mockups designs forming a merged template.

 

Years ago a user posted a template that had 84 layer groups for 84 product templates and in the future more products would be added.  The layered template file was already over 1GB in size.   I broke that files into 84 files and programed a single script the populated the 84 mockup templates files is a single run.  It still took the script over three hours to produce the 3,444 output jpeg files.   Combinging multiple mockup into a single file slow down processing. Increases  the completely of the Template files make it harder to create, maintain and use.     Do you think that  General Motors has one assemble lime the hast all parts and design element  for all of their car models they the are all produced in a single assembly line.

 

You are needlessly complicating your production process and it will take you a year or more to learn Photoshop Scripting.  Do your really want to become a programmer]?   My Advice to you is search Adobe Stock and the World Wide Web for  Mockup templates designs.  See how other design their Templates and see if the are any that are designed to be populated via some Automated process.  I know there are some designed to be populated with Adobe Photoshop automation.   There may also other automated process that do not  use Adobe products.   

 

You want to create your own Product designs.    You do not need to develop you own development tools and production line and program every line of code.   You can and should use products  available in the marketplace  to help you produces your  product jpeg files.  

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 09, 2022 Jan 09, 2022

Copy link to clipboard

Copied

LATEST

With the following code I get these resulting files from your examples. 

It is not exactly polished and might stand some (speed-related) improvements, but maybe it helps. 

Screenshot 2022-01-09 at 15.25.42.png

// replace smart object in smart object in artboards and save jpgs;
// 2021, use it at your own risk;
if (app.documents.length > 0) {main()};
function main () {
    try {
        var myDocument = activeDocument;
        var theName = myDocument.name.match(/(.*)\.[^\.]+$/)[1];
        var thePath = myDocument.path;
        var theArtboards = getArtboards ();
        var theFiles = selectFile (true);
        var theLayers = collectLayersByName ("YOUR DESIGN HERE");
        selectLayerByID(theLayers[0][2],false);
        var theSO = openSmartObject();
        for (var m = 0; m < theFiles.length; m++) {
            var thisOne = theFiles[m];
            replaceContents (thisOne, theSO.activeLayer);
            scaleToCanvasSize ();
// save;
            theSO.save();
            activeDocument = myDocument;
// create one copy per artboard;
            for (var n = 0; n < theArtboards.length; n++) {
                var theCopy = myDocument.duplicate("thecopy", true);
                cropTo (theArtboards[n][2][0], theArtboards[n][2][1], theArtboards[n][2][2], theArtboards[n][2][3]);
                saveJpg(thePath, theName, new File (thisOne).name.match(/(.*)\.[^\.]+$/)[1] + "_" + String(n));
                theCopy.close(SaveOptions.DONOTSAVECHANGES);
            };
            activeDocument = theSO;
        };
        theSO.close();
    }
    catch (e) {alert ("something is wrong")}
};
////// open smart object //////
function openSmartObject () {
    var idplacedLayerEditContents = stringIDToTypeID( "placedLayerEditContents" );
    var desc2 = new ActionDescriptor();
    executeAction( idplacedLayerEditContents, desc2, DialogModes.NO );
    return activeDocument;
    };
////// replace contents //////
function replaceContents (newFile, theSO) {
    app.activeDocument.activeLayer = theSO;
    // =======================================================
    var idplacedLayerReplaceContents = stringIDToTypeID( "placedLayerReplaceContents" );
    var desc3 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
    desc3.putPath( idnull, new File( newFile ) );
    var idPgNm = charIDToTypeID( "PgNm" );
    desc3.putInteger( idPgNm, 1 );
    executeAction( idplacedLayerReplaceContents, desc3, DialogModes.NO );
    return app.activeDocument.activeLayer
    };
////// select files //////
function selectFile (multi) {
if (multi == true) {var theString = "please select files"}
else {var theString = "please select one file"};
if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog (theString, '*.jpg;*.tif;*.psd;*.png', multi)}
else {var theFiles = File.openDialog (theString, getFiles, multi)};
////// filter files  for mac //////
function getFiles (theFile) {
    if (theFile.name.match(/\.(jpg|tif|psd|png)$/i) || theFile.constructor.name == "Folder") {
        return true
        };
	};
return theFiles
};
////// save a jpg //////
function saveJpg (thePath, theName, theNewName) {
// jpg options;
var jpegOptions = new JPEGSaveOptions();
jpegOptions.quality = 9;
jpegOptions.embedColorProfile = true;
jpegOptions.matte = MatteType.NONE;
//save jpg;
activeDocument.saveAs((new File(thePath+"/"+theName+"_"+theNewName+".jpg")),jpegOptions,true);
};
////// collect layers with certain name //////
function collectLayersByName (aName) {
    // the file;
    var myDocument = app.activeDocument;
    // get number of layers;
    var ref = new ActionReference();
    ref.putProperty(stringIDToTypeID('property'), stringIDToTypeID('numberOfLayers'));
    ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); 
    var applicationDesc = executeActionGet(ref);
    var theNumber = applicationDesc.getInteger(stringIDToTypeID("numberOfLayers"));
    // process the layers;
    var theLayers = new Array;
    for (var m = 0; m <= theNumber; m++) {
    try {
    var ref = new ActionReference();
    ref.putIndex( charIDToTypeID( "Lyr " ), m);
    var layerDesc = executeActionGet(ref);
    var layerSet = typeIDToStringID(layerDesc.getEnumerationValue(stringIDToTypeID("layerSection")));
    var isBackground = layerDesc.getBoolean(stringIDToTypeID("background"));
    // if group collect values;
    if (layerSet != "layerSectionEnd" /*&& layerSet != "layerSectionStart" && isBackground != true*/) {
    var theName = layerDesc.getString(stringIDToTypeID('name'));
    var theID = layerDesc.getInteger(stringIDToTypeID('layerID'));
    var theIndex = layerDesc.getInteger(stringIDToTypeID('itemIndex'));
    if (theName == aName) {theLayers.push([theName, theIndex, theID])}
    };
    }
    catch (e) {};
    };
    return theLayers
    };
////// based on code by mike hale, via paul riggott //////
function selectLayerByID(id,add){ 
    add = undefined ? add = false:add 
    var ref = new ActionReference();
        ref.putIdentifier(charIDToTypeID("Lyr "), id);
        var desc = new ActionDescriptor();
        desc.putReference(charIDToTypeID("null"), ref );
           if(add) desc.putEnumerated( stringIDToTypeID( "selectionModifier" ), stringIDToTypeID( "selectionModifierType" ), stringIDToTypeID( "addToSelection" ) ); 
          desc.putBoolean( charIDToTypeID( "MkVs" ), false ); 
       try{
        executeAction(charIDToTypeID("slct"), desc, DialogModes.NO );
    }catch(e){
    alert(e.message); 
    }
    };
////////////////////////////////////
function getArtboards () {
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); 
    var applicationDesc = executeActionGet(ref);
    var theNumber = applicationDesc.getInteger(stringIDToTypeID("numberOfLayers"));
    // anumber is intended to keep track of layerset depth;
    var aNumber = 0;
    var theArray = new Array;
    var theGroups = new Array;
    var theContents = new Array;
    ////// work through layers //////
    for (var m = 0; m < theNumber+1; m++) {
    //for (var m = theNumber; m >= 0; m--) {
    try {
    var ref = new ActionReference();
    ref.putIndex( charIDToTypeID( "Lyr " ), m);
    var layerDesc = executeActionGet(ref);
    var layerSet = typeIDToStringID(layerDesc.getEnumerationValue(stringIDToTypeID("layerSection")));
    var isBackground = layerDesc.getBoolean(stringIDToTypeID("background"));
    var theName = layerDesc.getString(stringIDToTypeID('name'));
    var theID = layerDesc.getInteger(stringIDToTypeID('layerID'));
    var theBounds = layerDesc.getObjectValue(stringIDToTypeID('bounds'));
    var theX = theBounds.getInteger(stringIDToTypeID('left'));
    var theY = theBounds.getInteger(stringIDToTypeID('top'));
    var theX2 = theBounds.getInteger(stringIDToTypeID('right'));
    var theY2 = theBounds.getInteger(stringIDToTypeID('bottom'));
    var artBoard = layerDesc.getBoolean(stringIDToTypeID("artboardEnabled"));
    var thisArray = [theName, theID, [theX, theY, theX2, theY2]];
    ////////////////////////////////////
    if (artBoard == true) {theArray.push(thisArray)};
    }
    catch (e) {};
    };
    // the results;
    return theArray
    };
////// crop //////
function cropTo (x1, y1, x2, y2) {
    // =======================================================
    var idCrop = charIDToTypeID( "Crop" );
        var desc7 = new ActionDescriptor();
        var idT = charIDToTypeID( "T   " );
            var desc8 = new ActionDescriptor();
            var idPxl = charIDToTypeID( "#Pxl" );
            desc8.putUnitDouble( charIDToTypeID( "Top " ), idPxl, y1 );
            desc8.putUnitDouble( charIDToTypeID( "Left" ), idPxl, x1);
            desc8.putUnitDouble( charIDToTypeID( "Btom" ), idPxl, y2 );
            desc8.putUnitDouble( charIDToTypeID( "Rght" ), idPxl, x2 );
        var idRctn = charIDToTypeID( "Rctn" );
        desc7.putObject( idT, idRctn, desc8 );
        desc7.putUnitDouble( charIDToTypeID( "Angl" ), charIDToTypeID( "#Ang" ), 0.000000 );
        desc7.putBoolean( charIDToTypeID( "Dlt " ), false );
        desc7.putEnumerated( stringIDToTypeID( "cropAspectRatioModeKey" ), stringIDToTypeID( "cropAspectRatioModeClass" ), stringIDToTypeID( "pureAspectRatio" ) );
        desc7.putBoolean( charIDToTypeID( "CnsP" ), false );
    executeAction( idCrop, desc7, DialogModes.NO );
    };
////// scale active layer to canvas dimensions //////
function scaleToCanvasSize () {
// scale smart object:
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var layerDesc = executeActionGet(ref);
var theBounds = layerDesc.getObjectValue(stringIDToTypeID('bounds'));
var theX = theBounds.getInteger(stringIDToTypeID('left'));
var theY = theBounds.getInteger(stringIDToTypeID('top'));
var theX2 = theBounds.getInteger(stringIDToTypeID('right'));
var theY2 = theBounds.getInteger(stringIDToTypeID('bottom'));
// determine the scale;
var theSOProp = activeDocument.width/activeDocument.height;
var theNewProp = (theX2 - theX)/(theY2 - theY);
if (theNewProp <= theSOProp) {var theScale = activeDocument.width / (theX2 - theX) * 100}
else {var theScale = activeDocument.height / (theY2 - theY) * 100};
// transform;
var desc23 = new ActionDescriptor();
var ref2 = new ActionReference();
ref2.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc23.putReference( charIDToTypeID( "null" ), ref2 );
var idOfst = charIDToTypeID( "Ofst" );
    var desc24 = new ActionDescriptor();
    var idPxl = charIDToTypeID( "#Pxl" );
    desc24.putUnitDouble( charIDToTypeID( "Hrzn" ), idPxl, activeDocument.width/2 - (theX+(theX2-theX)/2) );
    desc24.putUnitDouble( charIDToTypeID( "Vrtc" ), idPxl, activeDocument.height/2 - (theY+(theY2-theY)/2) );
desc23.putObject( idOfst, idOfst, desc24 );
var idPrc = charIDToTypeID( "#Prc" );
desc23.putUnitDouble( charIDToTypeID( "Wdth" ), idPrc, theScale );
desc23.putUnitDouble( charIDToTypeID( "Hght" ), idPrc, theScale );
desc23.putEnumerated( charIDToTypeID( "Intr" ), charIDToTypeID( "Intp" ), stringIDToTypeID( "bicubicAutomatic" ) );
desc23.putEnumerated( stringIDToTypeID( "freeTransformCenterState" ), stringIDToTypeID( "quadCenterState" ), stringIDToTypeID( "QCSAverage" ) );
//            desc23.putBoolean( charIDToTypeID( "Cpy " ), true );
executeAction( charIDToTypeID( "Trnf" ), desc23, DialogModes.NO );
app.preferences.rulerUnits = originalRulerUnits;
};

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines