I get this scrip from somebody,It is used to auto get the imagesize in Indesign,Open in ps.
here the image size is touch with "Direct Selection Tool",then we see the ture width.
but,here, I would like to get the “”true width +12mm“”,
the bug is coming,some time It is right.the size is right.
but some times,the size is small, It is not I need, not I hope。
Can you help me ? (the script is under,save to js,please, the soft is ID CS6)
My E-mail:57400673@qq.com
Thank you very much
-------------------------------------------------------------------------------
Main();
function Main() {
var image = app.selection[0].images[0];
var imagePath = image.itemLink.filePath;
var hScale = image.horizontalScale;
var vScale = image.verticalScale;
CreateBridgeTalkMessage();
function CreateBridgeTalkMessage() {
var bt = new BridgeTalk();
bt.target = "photoshop";
bt.body = myResizeImage.toSource() + "('" + imagePath + "'," + hScale + "," + vScale + ");";
bt.send();
}
}
function myResizeImage(imagePath, hScale, vScale) {
var myFile = new File(imagePath);
var myDoc = app.open(myFile);
var oh=myDoc.width.value * hScale *0.010;
var ov=myDoc.height.value * vScale*0.010;
var oh=oh+12.00;
var ov=((ov*(oh+12.00))/oh);
myDoc.resizeImage(oh,ov, 350);
}