Home

Creating Background Borders With Photoshop Scripting

This is what I used to add a white boarder with a black pen line to my instagram photos.

#+FILENAME: AWS-Instagram-Boarder.jsx #+begin_src js :results output :wrap example :tangle "/Applications/Adobe Photoshop 2022/Presets/Scripts/AWS Instagram Border.jsx"

var doc = app.activeDocument;

function main(black_border, white_border) { setBg(0,0,0); addBorder(black_border); setBg(255,255,255); addBorder(white_border); }

function setBg(r,g,b) { var new_color = new SolidColor(); new_color.rgb.red = r; new_color.rgb.green = g; new_color.rgb.blue = b; backgroundColor = new_color; }

function addBorder(border_size) { doc.resizeCanvas(UnitValue(doc.width + (border_size * 2) , 'px') , UnitValue(doc.height + (border_size * 2) , 'px') ); }

main(2, 38);

#+end_src

#+TODO:

- Write a post on installing and using Photoshop Scripts

~ fin ~