Try this (NOTE, edited existing code without testing, so bugs likely) function cropPercentage(ratio) { if (app.documents.length > 0 && ratio < 0.5) { var doc = app.activeDocument var crop_w = Math.floor(doc.width*ratio + 0.5) var crop_h = Math.floor(doc.height*ratio + 0.5) doc.crop(new Array(crop_w, crop_h, doc.width-crop_w, doc.height-crop_h)) } },
... View more