From the course: InDesign Secrets

264 Use a script to set the table subhead row style - InDesign Tutorial

From the course: InDesign Secrets

264 Use a script to set the table subhead row style

- [Instructor] I use computers because I'm basically lazy, and I want them to do the work for me, at least the boring drudge work, right? And there are few things as boring as formatting tables that have a bunch of different kinds of rows, like various headings, subheadings, and so on. For example, here's a table that I've imported, and I need to format this fast. So, normally I would go grab the Type tool, and then I would start applying cell styles, like I'll select this row here, and I'll come over here and say that's a Planet row. And then this next one down here is going to be a Detail row, and so on. And you can see that this would take a long time and be really boring. So, wouldn't it be cool if I could automate this, applying all of the cell styles in one go? Well, thanks to Chuck Weger and Deb Haines, you can. Chuck and Deb were both attendees at a recent PePcon conference. That's the Print and e-Publishing Conference that Anne-Marie Concepcion and I host each year. And Chuck and Deb were talking, and Deb was explaining this problem, and Chuck, who has been developing software for decades, went back to his hotel room and wrote a script. A simple, but brilliant little script that solves this problem. And he told me I can just give it away for free. To show you how it works, I'm going to jump to the next page of this document with shift + page down, and you can see that I have this same table with one difference, I have a new column along the left edge. And this column tells the script which cell style should be applied to each row. So, for example, here it says Planet, so that means apply the Planet cell style to the entire row. Here's one for the Sub-Subhead, here's one for Subhead, and so on. And the script does one other thing. If the heading, for example this planet called Mercury, if that is followed by a bunch of blank cells, then the script is smart enough to know to merge all of those cells together. Let's go see it in action. I'm going to grab the Selection tool and select the entire text frame, and then I need to run the script from the Scripts panel, and I can find that by going to the Window menu, coming down to Utilities, and then choosing Scripts. We've talked about how to install scripts into your Scripts panel in earlier videos, so I'm not going to get into that now. But you can see that I've installed the Deb-o-Matic script inside my User folder. I'll open it up and you can see it. There's Deb-o-Matic.jsx, that's the script file. Now, why is it called Deb-o-Matic? Well, because it was written for Deb Haines, right? Deb works for a great company called XMPie, which does database publishing tools. Anyway, Chuck has a very funny sense of humor, so he called it Deb-o-Matic. To run this, all I need to do is double click on the script inside the panel. As soon as I do that, you can see it jumps into action, and boom, it's done. All of those cell styles were applied, and you can see that here, this entire row was merged into a single cell. Finally, when the script was done, it removed that first column because, of course, we don't need that anymore. Now, this script is not for everyone. After all, you still have to get all those style names into that first column, and that takes time. But if you have tables with tons of subheads and stuff, this could really save you far more time, especially if you have lots and lots of tables to format. Now, where can you find this script? You can find it on our site at InDesignSecrets.com. Just go to our page on free plugins and scripts. It's in the section on scripts that we mentioned in our videos. And if you find you really like this script, go check out Chuck's website at elara.com. Send him a note and tell him what you think.

Contents