Hi. Try to run this from Indesign CS5 script panel. #targetengine session if (app.activeDocument.eventListeners.itemByName('placeEvent')!=null){ app.activeDocument.eventListeners.itemByName('placeEvent').remove(); } var prf = [50, 50]; var d = new Window ('dialog', 'input bounds size', [100,100,360,290]); d.mp = d.add('panel', [10,20,245,115], 'input radius and radian'); d.mp.st1 = d.mp.add('statictext', [50,24,100,40], 'width = '); d.mp.et1 = d.mp.add('edittext', [110,20,170,40],prf[0], {multiline:false}); d.mp.st2 = d.mp.add('statictext', [50,54,100,70], 'height = '); d.mp.et2 = d.mp.add('edittext', [110,50,170,70],prf[1], {multiline:false}); d.bp = d.add('panel', [10,130,245,175], ''); d.bp.submitBtn = d.bp.add('button', [20,10,100,25], 'apply', {name:'ok'}); d.bp.stopBtn = d.bp.add('button', [120,10,200,25], 'stop', {name:'cancel'}); d.bp.submitBtn.onClick = function (){ var wdt = d.mp.et1.text - 0; var hgt = d.mp.et2.text - 0; if(f.open('w')){ var retStr = wdt + ":" + hgt; f.write(retStr); } applyListener(wdt, hgt)}; d.bp.stopBtn.onclick = function (){ removeListener() }; d.show(); function applyListener(w,h){ var listner = app.activeDocument.addEventListener ( 'afterPlace', function (ev){ var tg = ev.target; var mybnds = tg.geometricBounds; tg.geometricBounds = [mybnds[0],mybnds[1], mybnds[0]+h, mybnds[1]+w]; tg.fit (FitOptions.fillProportionally); tg.fit (FitOptions.centerContent); }); listner.name = 'placeEvent'; d.close(); } function removeListener(){ app.activeDocument.eventListeners.itemByName('placeEvent').remove(); alert ('place tweak removed.'); d.close(); } Once running it, catch place event and images rectangles force to adjust preset width and height. If you select rectangle when placing image, It adjust fillPropotionally automatically. Ten
... View more