June 16 2006 • 4:37 AM

Get Rid of That Absurd Section Prefix

Steve T. wrote

InDesign automatically inserts text into the section prefix field, causing problems with a third-party plug-in, Made-To-Print. The plug-in gets confused between the actual page number and the “Sec:1″ text, causing lots of errors in output. We’re forced to manually delete the text from this field for every multi-page layout in the magazine. Very inefficient. So I guess the question is: is there a way to force InDesign to keep Section Prefix field blank?

Steve, believe me when I say how much I hate that “Sec:” text, which InDesign automatically adds as in the Prefix field each time you create a new section (using the Section & Numbering feature in the Pages palette). I can only assume that Adobe inserts this prefix in order to help “build character” or perhaps just to annoy us.

Unfortunately, I can’t think of any good way to change this preference, so I’ve done what you’ve done: Manually selected and deleted the “Sec:” in the Prefix field. Until now.

Dave Saunders, scripter extraordinnaire, wrote the following script, which both erases anything in the Prefix field for every section in the open document and makes sure the Include Prefix When Numbering Pages option is turned off. (The latter is completely unnecessary, since there is no Prefix, but it’s what Dave calls a “belt and bracers” solution.)

//DESCRIPTION: Delete all section prefixes and switch them off
if (app.documents.length > 0) {
aDoc = app.activeDocument;
aDoc.sections.everyItem().sectionPrefix = “”;
aDoc.sections.everyItem().includeSectionPrefix = false;
}

Note that you can download this little script by clicking here. Don’t know how to install scripts? Click here for instructions. If this saves you oodles of time, feel free to send a little PayPal donation to davesaunders [at] pdsassoc.com. Of course, use it at your own risk, and so on.

10 Responses discussing this post. Add yours below.

  1. June 16th, 2006 • 10:57 am • Link

    It you look up “bracers” in the dictionary, you won’t find this Hampshire-English mangling of “braces” — which, according to the on-line dictionaries is British for “suspenders.” If you pursue that, you’ll find that “suspender” is British for “garter.” So no wonder I stuck with my Hampshire roots and spell the word the way we used to say it as kids: “bracers”!

    All of which brings to mind the Morecambe and Wise skit that started “I say, I say, I say, why does Mr. Kruschev wear red, white and blue braces?”

    But I digress.

  2. Steve Traynor
    June 16th, 2006 • 2:51 pm • Link

    Thanks David and Dave, this works pretty neat! I did find one instance where it didn’t seem to work: when the prefs are set to section numbering instead of absolute numbering and you select a page that’s not the start of a section, the prefix still appears. I don’t think this is an issue as my pages exported to PDF without problems.

    Again, thanks for the handy script (and the zippy resonse!)

    Steve

  3. June 16th, 2006 • 4:31 pm • Link

    Steve,

    That sounds weird (although I’m glad you found a workaround). My script wipes out the prefixes and then tells them to not appear. So if you have a document where a prefix survived the script and then had the temerity to appear anyway, I’d be interested in seeing it. If you can reproduce the problem in a small document can you send it (or perhaps a .inx version of it) to support@pdsassoc.com please.

    Thanks,

    Dave

  4. June 19th, 2006 • 7:00 pm • Link

    Some off-line discussion with Steve and further experimentation reveals this:

    1. My script is good for cleaning up after-the-fact. It does nothing to prime the contents of that field if you subsequently make a new section.

    2. That value, though is sticky. If you make a new section and then hit tab followed by delete, that will eliminate the “Sec1:” prefix for the section you are now creating AND prime the field for the next section you create — from then on, in that document, they’ll be blank.

    This suggests that the prefix is a document level preference held somewhere, but a search of the InDesign Scripting Reference fails to show any other reference to section prefix, so, if you want to avoid using my script to clean-up after the fact, just hit tab-delete the first time you create a section.

    Dave

  5. Anne-Marie
    June 23rd, 2006 • 3:14 am • Link

    Thanks, Dave! That’s another neat little “best practice” technique to add to our arsenal here. (And thanks to Steve for helping us all figure this out.)

  6. Mark Shorter
    August 1st, 2006 • 4:06 pm • Link

    This script sounds wonderful, however I’m still with CS1. How could I change it to function as intended with CS1?

    Mark

  7. Ken
    January 10th, 2007 • 7:17 pm • Link

    Looks like the script works as long as the numbering is set to “Start page numbering at”. All of my pages are set to “Automatic Numbering” and the script will not remove the prefix.

    thanks for the script though. It was a great idea. Hopefully it can be made to work in both cases someday.

  8. March 17th, 2009 • 11:20 am • Link

    Awesome script it’s working in great in eliminating those annoying section markers.. Hope the printer can output my file correctly then.

  9. julie
    May 28th, 2010 • 11:48 am • Link

    script didnt work. the sect:1 appears as always.

  10. Wininger
    December 8th, 2011 • 11:11 am • Link

    Hello, Hi, Hey, great article, post, blog, I, we love, like, loved, liked it !!!

Subscribe to the Discussion

Get the ongoing discussion surrounding "Get Rid of That Absurd Section Prefix" 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.