Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign!

Transform a Frame Into a Grid of Frames

Dave wrote:

How can I divide a graphic frame into equal parts… like making four equal squares inside a larger square?

I was absolutely, positively sure we covered this sometime over the last few years, but I must have been dreaming it because even google can’t find it. I’m shocked because I like to take partial credit for this feature existing. I was training some newspaper folks at a big paper a couple hours from here and they wanted to know how to make a grid of objects on their page. Back in the QX days, they used an XTension (from Visions Edge, I think) to convert any frame into a grid of objects. But now what were they to do?

I was stumped (sure, they could use Step and Repeat, but it’s not easy to figure out the math). But when I returned home I asked my co-author Olav Martin Kvern, and he wrote up a quick script for it. I emailed it to my client the next day and everyone was happy.

Fortunately for all of us, Ole is also the script guru on the InDesign team and he liked the script so much that he added it to the sample scripts that ship with the program. It’s called MakeGrid.jsx and it’s installed by default in CS3. (In CS2 you have to install it from the discs or find it on the Adobe Web site.) You can find the script by choosing Window > Automation > Scripts, then opening the Samples folder inside the Scripts folder.

Select any frame on you page, and when you double click the script, you’ll see this:

When you click OK, InDesign transforms the single frame into a bunch of frames!

Actually, technically, you can select even more than one frame before running the script and it’ll affect all of them. And, as you can probably tell from the above dialog box, you can even place the original content into the final frames. For example, here’s one big picture that is split into 100 smaller frames… then some of the frames were deleted:

David Blatner
David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at Lynda.com are among the most watched InDesign training in the world. You can find more about David at 63p.com.
David Blatner

Latest posts by David Blatner (see all)

Tags
Related Articles
Comments

37 Comments on “Transform a Frame Into a Grid of Frames

  1. Cool idea for using such a script. I haven’t had need for it, but it’s given me an idea for a leaflet I’m planning to make.

  2. Morning David,
    I sent you and Anne a post about scripts over the weekend. Don’t know if you guys got it or not.

    Here, it is again. The sample scripts provided by CS3 are offered in both applescript form and javascript form. Is there a difference between the two? Is one better than the other? And if they are the same, why do they offer it in two different forms? Is that so they can by used on a Mac and/or PC or?

  3. Pete: Sorry, we’re a bit behind in responding to email. The answer is: Both the javascripts and the applescripts (or VBscripts on Windows) should work just as well. They offer them in two flavors because the primary reason they’re there is to be samples for scripters to learn from… the fact that they happen to be incredibly useful to normal users is sort of a side-effect.

  4. You always amaze me, how quickly you reply. Do you sit at your computer 24/7?

    I and a good friend of mine at work, were discussing you the other day. We can’t understand how you can do all that you do and follow all that you follow and get everything done.
    I could spend hours online reading everything but then I would never get anything done at work. But you seem to follow everything and still do so much more. Anyway enough of your time. We love your books as well. We have been following you through Quark and now InDesign. Not only are they great, but you add the touch of humor that is necessary when digging for answers.

    Thanks for the reply!

  5. Wow, that is fantastic!

    I am going to be using this script a lot as making grids of pictures is a big part of my job. I?ve already made a shortcut for it.

    This will save me a lot of time. Until now, I?ve had to use mathematical operations in the control panel to work out sizes, followed by step and repeat. It all takes a lot of thought. (The thing I hate most is always having to click on that tiny proxy.)

    It?s just a shame the gutter measurements default to points instead of my default units (mm), and that the gutter value isn?t remembered (as I always use the same gutter size). That would save even more time!

    Thanks, David (and Ole of course)!

  6. Just solved my own problem?

    I changed the two parts of the script that said:
    ?editValue:12, editUnits:MeasurementUnits.points});?

    To:
    ?editValue:8.504, editUnits:MeasurementUnits.millimeters});?

    And now my gutters default to 3mm! :D

    (It makes me tempted to start writing my own scripts!)

  7. This script isn’t included on the education version CS@ CDs. Searching Adobe’s web site yields a similar but different script, “Split Into Grid” which also defaults to point measurements.
    I tried editing “”Split Into Grid” to default to inches, using inches instead of millimeters as a previous poster suggested but the script doesn’t run after replacing “points” with “inches.”
    Is MakeGrid.jsx available as a stand-alone download anywhere online? Does anyone know what change could make the script editable in inches rather than in pints measurements?
    Thanks to anyone w/ the answers.

  8. Google “makegrid.jsx”

    If you want, you can go to Layout>Create Guides, then input the amount of columns and rows and the spacing, set it to Margins if you want, then insert a frame yourself, duplicate them to save time, and have a Object Style for Fit Frame Proportionally, or whatever you want for it.

  9. Can someone possibly help me out? When I switched to Leopard (I’m using CS3) my scripts stopped working. They are all installed in the right spots, all showing up where they should. I double click on a script to use it (like I always did…) I get the beach ball for a split second, then nothing happens. Any ideas?

  10. @Lauren when this happens, the solution is usually to rebuild your preferences. (See Resources > InDesign FAQ at the top of this page.)

  11. Well, I guess you could do it that way. :P I’ve always just used the Distribute command with zero space between.

    Create a square (with NO STROKE; a stroke will offset the distribute), copy it horizontal for the number of columns you want, and then Distribute with zero space.
    Group that row.
    Copy the row vertically for the number of rows you want and then distribute with zero space.
    Group the whole mess.
    Now you can scale it to your heart’s desire and then give it whatever stroke and fill you want.

  12. @Chien: I wrote this elsewhere in reply your question, too: I don’t know any way to select multiple inline objects. It is a frustrating limitation.

  13. After creating the separate grid frames, if you want guides just keep them selected and run the ‘AddGuides’ script. :)

  14. Hi

    This script and way to find it really saved me a lot of time and effort. Thank you so much. However, I´ve got a question for you; when I´m done making the grid how can I go back to dialog box and adjust sizing of boxes and space (gutter?) between them after closing the dialog box once…?

  15. @samacom: The only way to adjust the gutters would be the Gap tool (new in CS5). And that only works on one column or row at a time. If you think you will need to adjust the spacing, it is probably better to disable “Delete Original Object” so you can keep the original on the pasteboard or on a hidden layer, ready to convert again.

  16. @Paula: Yeah, I think Adobe killed that page on their site. But fortunately, the script ships with CS3 and later. Just look in the Scripts folder, then open Samples/Javascript.

  17. Another way to accomplish this is if you press the arrow keys while dragging out any of the frame tools, you can automatically split the frame into a grid of smaller frames. Each tap of the Up or Down arrow key adds or removes a grid column, while Right or Left arrows add or remove grid rows.

  18. Hey Dave,
    I am confuse about inserting the image. How can i insert the image like what you did above? I want to insert one image into the many frame.
    Thanks, Visal

  19. I am using CC and it does not work.
    MakeGrid.jsx is in the script panels folder, but the MAKE GRIP window does not appear.
    Any suggestion?
    Thanks.

  20. I have a trapezoidal shape. How can I split horizontally into several parts so that I can add images to it? Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *