Fit Frame Using the Context Menu
This script for Adobe InDesign allows you, with the help of the mouse right button, to fit the selected frame (or several frames) to these selected objects: page margins, page borders, bleeds, or the baseline of the bottom line of the text (if a text frame is selected). It is much easier than trying to catch the desired edge of the frame with the mouse and dragging it to the desired guide, then doing the same operation with the opposite edge.
Place the script to the "startup scripts" folder and restart InDesign.
If, after copying the script to the specified folder, the program generates an error at startup, read the article "Accessing the script from a localized menu". If the problem persists, use the feedback for help.
If the script does not appear in the menu...>>
Update to the version 1.1 from February 2017
The algorithm for adding to the menu has been redesigned so that embedding now takes place regardless of the version and localization of InDesign. More information on the topic can be found in the article "Localized menu: the adventure continues".
Align all frames of the story
If you want to fit all the frames of the selected story to the margins on all the pages they occupy, set the cursor in this story and use this script below:
var myDoc = app.activeDocument; var mySel = myDoc.selection[0].parentStory.textContainers; for (i=0;i<mySel.length;i++){ var myPage = mySel[i].parentPage; var myPB = myPage.bounds; var myMar = myPage.marginPreferences; if (myPage.side == PageSideOptions.LEFT_HAND){ var gb = [myMar.top,myMar.right,myMar.bottom,myMar.left]; } else{ var gb = [myMar.top,myMar.left,myMar.bottom,myMar.right]; } mySel[i].geometricBounds = [myPB[0]+gb[0],myPB[1]+gb[1],myPB[2]-gb[2],myPB[3]-gb[3]]; try{mySel[i].fit(FitOptions.CONTENT_TO_FRAME);}catch(e){} }
You can thank here
Comments: 5
Christian Geiselmann (17.07.2019 16:18) E-mail |
Extremely useful! A real time-saver for projects with many pages such as book! |
Reply |
Galeb (29.01.2021 19:23) E-mail |
Hi, great helper. Is there a way to address the entries via a keyboard shortcut? Best, Galeb |
Reply |
Admin (02.02.2021 11:51) E-mail |
Galeb, the entries can be found in the "Edit > Keyboard Shortcuts" menu in the "scripts" product area. |
Reply |
Other scripts:
For Tables
- Common Formatting of Several Tables
- Exact Table Alignment
- Search-replace the Table Stroke Weight
- Split Table Row by Paragraphs
- Search Table Cell Overflows
For Text
- Merge Repeating Lines of Index
- Table of Contents Correction: Update Page Numbers Only
- Change Numbers In Text
- Split Text By Paragraphs
For Styles
- Change Font Size In Styles
- Compare Styles
- Transliterate style names
- Copy GREP Styles
- Quick Apply Paragraph Style Then Next Style
- Change Language in Styles and in the Text
- Removing Character Styles In the Text (Controlled by User)