Hi Kai Rübsamen The script of "fit to 4 size page" is very Perfect I am so sorry,for I comebake to Pester you,I must admit, I am so greedy ① I find the"fit to margins " and "fit to page" is not rigth,when my text only 1 row~ ② and I want to know,How to fit to Column...... Thank you very much~ It is the script ------------------------------------------------------------------------------------------------------------------------------------------ var curDoc = app.activeDocument; if ( app.selection.length != 1 ) { ( alert ( "Something wrong with your selection!" ) ); exit(); } var curSel = app.selection[0]; var curPage = curSel.parentPage; // set the zeroPoint to 0 var zP = curDoc.zeroPoint; if (zP != [0,0]) { curDoc.zeroPoint = [0,0]; } var rO = curDoc.viewPreferences.rulerOrigin; if (rO != 1380143215) { curDoc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin; } var pW = curDoc.documentPreferences.pageWidth; var y1, x1, y2, x2; if ( curPage.side == PageSideOptions.leftHand ){ x2 = curPage.marginPreferences.left; x1 = curPage.marginPreferences.right; } else { x1 = curPage.marginPreferences.left; x2 = curPage.marginPreferences.right; } x2 = pW - x2; var gB = curSel.geometricBounds; // fit to margins gB[1] = x1; gB[3] = x2; curSel.geometricBounds = gB; // fit to page /*gB[1] = 0; gB[3] = pW; curSel.geometricBounds = gB;*/ curSel.fit ( FitOptions.FRAME_TO_CONTENT ); resetAsBefore(); function resetAsBefore() { if ( rO != 1380143215 ) { curDoc.viewPreferences.rulerOrigin = rO; } // set the zeroPoint back to the origin state if (zP != [0,0]) { curDoc.zeroPoint = zP; } }
... View more