place a pictures and the left=0,top=0
hi everybody:
i want to place a pictures and the left=0,top=0,there is a script to using "offset",but offset is Bad calculation,
(function placeEvent_08499145507813()
{
try {
var d = new ActionDescriptor();
d.putPath(stringIDToTypeID("null"), new File("~/Pictures/timg.jpg"));
d.putEnumerated(stringIDToTypeID("freeTransformCenterState"), stringIDToTypeID("quadCenterState"), stringIDToTypeID("QCSAverage"));
var d1 = new ActionDescriptor();
d1.putUnitDouble(stringIDToTypeID("horizontal"), stringIDToTypeID("pixelsUnit"), -50);
d1.putUnitDouble(stringIDToTypeID("vertical"), stringIDToTypeID("pixelsUnit"), -29.5);
d.putObject(stringIDToTypeID("offset"), stringIDToTypeID("offset"), d1);
d.putUnitDouble(stringIDToTypeID("width"), stringIDToTypeID("percentUnit"), 67.5);
d.putUnitDouble(stringIDToTypeID("height"), stringIDToTypeID("percentUnit"), 83.5271317829457);
executeAction(stringIDToTypeID("placeEvent"), d, DialogModes.NO);
}
catch (e) { if (e.number!=8007) { alert("Line: "+e.line+"\n\n"+e,"Bug!",true); throw(e); } }
}
)();

