F
F
FronzZ2021-03-13 05:01:32
Adobe Photoshop
FronzZ, 2021-03-13 05:01:32

How to make a canvas enlargement macro for all photos?

Hello! Maybe someone knows how to make a macro in Photoshop so that the size of the canvas from below increases by 170px on all images?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pumpkinm, 2021-03-13
@FronzZ

var uMargin = new UnitValue("170 pixels");
var dir = new Folder("D:\\ImagesFolder");

app.playbackDisplayDialogs = DialogModes.NO;

if (dir != null) {
  var fileList = dir.getFiles("*.jpg");
  for (var i = 0; i < fileList.length; i++) { 
    try {
      open( fileList[i] );
      app.activeDocument.resizeCanvas(app.activeDocument.width,app.activeDocument.height+uMargin,AnchorPosition.TOPCENTER);
      app.activeDocument.save(SaveOptions.SAVECHANGES);		
      app.activeDocument.close();		
    }
    catch(e) {
      // бла-бла
    }
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question