So I found another script you wrote on the forums that effects the canvas size, just need help with the math bits. Here's what I've got now:
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
var wdth = app.activeDocument.width;
var hght = app.activeDocument.height;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
if(wdth % 4 == 0){ alert("width is divisible by 4");
}else{
myDocument.resizeCanvas(myDocument.width + 20, myDocument.height + 20, AnchorPosition.MIDDLECENTER)
}
};Right now it's just adding 20px, but I need to make that whatever is needed in order to get the canvas to divide by 4. Math is not something I'm strong with, so if you've got any ideas, that would be great!