Answered
How can I expand the selection
how can i expand the selection so automatically snap the upper left corner of the canvas, i need this to batch multiple files of different dimensions.
example:

how can i expand the selection so automatically snap the upper left corner of the canvas, i need this to batch multiple files of different dimensions.
example:

sTT = stringIDToTypeID;
dsc2 = new ActionDescriptor()
bnds = activeDocument.selection.bounds
slctn = {top: 0, left: 0, bottom: bnds[3], right: bnds[2]};
(ref = new ActionReference()).putProperty(sTT('channel'), sTT('selection'));
(dsc1 = new ActionDescriptor()).putReference(sTT('null'), ref); for(i in slctn)
dsc2.putUnitDouble(sTT(i), sTT('pixelsUnit'), slctn[i])
dsc1.putObject(sTT('to'), sTT('rectangle'), dsc2)
executeAction(sTT('set'), dsc1);Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.