Michael L Hale wrote:
To use percentage with UnitValues you need to set the baseUnit property to whatever value 100% would be. Unless your doc is square you will need two UnitValue objects. It really is a lot eaiser to just use a distanc unit such as in or cm and do the math in the value side of the argument.
doc.resizeImage(UnitValue((doc.width.as('in')*.5),"in"),UnitValue((doc .height.as('in')*.5),"in"),null,ResampleMethod.BICUBIC);
Hmmh? I'm confused.
Perhaps my English is to bad or I missunderstood your post.
Working with percent is easy in my opinion:
// ResizeDocByPercent.jsx// resize a document in percent// http://forums.adobe.com/thread/1226639?tstart=0// regards pixxxelschubser
var aDoc = app.activeDocument;
app.preferences.rulerUnits = Units.PERCENT;
aDoc.resizeImage(50,undefined,undefined,ResampleMethod.BICUBIC);
Does this works for you correct?