September 1 2008 • 1:50 PM

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:

18 Responses discussing this post. Add yours below.

  1. September 1st, 2008 • 2:41 pm • Link

    Excellent; many thanks!!

  2. September 1st, 2008 • 3:10 pm • Link

    Nice tip! Thanks!

  3. Roland
    September 1st, 2008 • 11:54 pm • Link

    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.

  4. September 2nd, 2008 • 4:23 am • Link

    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?

  5. David Blatner
    September 2nd, 2008 • 4:53 am • Link

    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.

  6. September 2nd, 2008 • 5:07 am • Link

    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!

  7. September 2nd, 2008 • 7:19 am • Link

    Great tip! I never knew that script was there. Many thanks!

  8. Lee
    September 4th, 2008 • 1:30 am • Link

    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)!

  9. Lee
    September 4th, 2008 • 1:48 am • Link

    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!)

  10. Adrian
    September 4th, 2008 • 4:45 am • Link

    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.

  11. Eugene Tyson
    September 4th, 2008 • 5:24 am • Link

    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.

  12. September 5th, 2008 • 5:50 am • Link

    This script has come in handy many times for me, but I hadn’t tried it on a frame with an existing image inside. Good stuff. Thanks!

  13. September 5th, 2008 • 9:41 am • Link

    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?

  14. David Blatner
    September 5th, 2008 • 10:06 am • Link

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

  15. Don Ayer
    September 5th, 2008 • 12:44 pm • Link

    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.

  16. September 6th, 2008 • 8:50 am • Link

    @David, Thank you! Fixed!

  17. Chien
    November 16th, 2008 • 2:15 am • Link

    Can you tell me, how to select multi inline graphics in a file. Maybe have some plugins to solve this problem?
    Thanks

  18. David Blatner
    November 18th, 2008 • 6:53 am • Link

    @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.

Subscribe to the Discussion

Get the ongoing discussion surrounding "Transform a Frame Into a Grid of Frames" delivered to you. Click here to subscribe via RSS.

Leave a Reply

You can use limited HTML tags, such as <em></em> for emphasis/italics and <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

InDesignSecrets reserves the right to edit and/or remove posts and comments.