I can find lot of stuffs there, but when i tried to search for the above options, i couldn't find it.
I just want to click the scaling proportionally options in the control panel menu through script,
instead of using this..app.selection.fit(FitOptions.FILL_PROPORTIONALLY);
so, this is what i m trying is...
app.selection.horizontalScale = width of the page - both margins;
(not mentioning the vertical scale percentage here, bcause, Im trying to click the Constrain proportionally when scale option in control panel)
thanks in advance VAM.
I'm sorry if i m confusing...
1 person found this helpful
As far as I know you can't switch this option by JS (no such application preference to use)
But Vam showed you the way how to reach your goal just with THIS method "resize()"
mObj = app.selection; tarWidth = widthOfThePage - bothMargins; // variables to set mObj.resize( CoordinateSpaces.INNER_COORDINATES, AnchorPoint.TOP_LEFT_ANCHOR, // another? ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, [tarWidth, ResizeConstraints.KEEP_CURRENT_PROPORTIONS] )
PS: Vam showed this way to me as well, to tell you the true
well.. first of all, you can't manipulate the interface from scripting, with the exception of "clicking" a menu.
second, it's usually a bad idea to try to emulate using scripting the exact things you do manually form the interface. You miss out on most of the power of scripting, and using things like: app.select(), app.copy etc comes with a large performance penalty.
using scripting you can access an object (or even a lot of objects) directly, without needing to select it before, and you can manipulate them in any way you want.
for your example, using a fixed width of 120mm:
also, remember that a page does not have a "width" property (weird, i know), it has a bounds property in the format [y1, x1, y2, x2]. so:
for the margins you can use http://jongware.mit.edu/idcs5/pc_MarginPreference.html
Best of luck,
Ideas & ideas,
Genius & Genius,
Hi Jump_over & Vamitul..
Ofcouse, vam it looks difficult to understand at this starting point, by now and till, I try to learn the ideas of scripting.
thanks for the great idea to both of you.G.