Text string in title case?

Peter Gold peter at knowhowpro.com
Fri Feb 29 09:03:51 PST 2008


In the days of FM/unix, before book-wide search/replace and other
come-lately power features, something like this would be done with
fmbatch and one or more of GREP, AWK, and SED text-manipulation tools.

The general plan was to use control fmbatch with a unix script to
convert all appropriate .fm files to MIF, then perform the
text-crunching on the MIF files, then reconvert the MIF files back to
.fm with fmbatch.

If there's enough volume to repay the effort, something similar would
work today with mif2go from omsys.com, dobatch from cudspan, dzbatcher
from datazone.com, or FM2MIF (a new free utility that installs under
FM's File > Utilities menu option, from dtptools.com, to convert
directories-full of .fm files to MIF). I believe mif2go's MIF
converter is free; dobatch and dzbatcher are free. All but FM2MIF work
like fmbatch.

Instead of the unix tools, Perl or other newer text-manglers can do
the find/replace, perhaps with the assistance of GREP.

Converting .fm to MIF is the first step.

The second step would be to find all the ALL CAPS titles in all the
MIFs, collect them into a single-column list from which you can remove
the duplicates, and create a second column with the precise conversion
for each title - this would settle style issues over which title words
to make all lowercase, etc.

The third step would be to find and replace every instance of the
uppercase titles with their title cased partner in the MIF, without
damaging the MIF file's integrity. This may take some care in cases
where the titles break across lines, etc.

Finally, you'd use one of the fmbatch-replacements to reconstruct .fm
files from the MIFs.

I'm not a coder or scripter. Heck, my long-term and short-term memory
aren't that good anymore. BUT, it's hard to forget a proven tool-chain
process like this.<G>

HTH
Regards,

Peter
_______________________________
Peter Gold
KnowHow ProServices

On Fri, Feb 29, 2008 at 10:33 AM, Paul Findon <pfindon at infopage.net> wrote:
> Hi Tina,
>
>  This is impossible with FrameMaker alone. I thought perhaps Spell
>  Catcher could handle it, as it does have commands for changing case
>  to Title style, but even that simply capitalises the first letter of
>  each word.
>
>  A job for AppleScript perhaps? (NG to you unless you use Mac
>  FrameMaker.)
>
>  I found a script at <http://bbs.applescript.net/viewtopic.php?
>  id=13297> that, in addition to changing case to Title style, can also
>  set a bunch of specified definite and indefinite articles,
>  conjunctions, and prepositions that don't start a sentence to
>  lowercase. Something the script author has called "Mixed" style.
>
>  I'm not a programmer, but with a little head scratching, I managed to
>  edit this script so that it searches an open FrameMaker document and
>  changes all paragraphs tagged "Heading1" or whatever you like to
>  Mixed style. Works a treat!
>
>  Incidentally, for Title style (or what CMOS calls "Headline" style),
>  do you follow the Microsoft style of not capitalising prepositions of
>  four or fewer letters. Or Apple's style of not capitalising
>  prepositions of three or fewer letters. Or CMOS's recommendation of
>  lowercasing prepositions regardless of length?
>
>  Styles - you gotta love 'em.
>
>  Paul
>
>
>  > Hi all,
>  >
>  >
>  >
>  > I'm trying to put many text strings (book titles) throughout a long
>  > book
>  > into title case. I need to do this at the character level, not the
>  > paragraph. For example, changing
>  >
>  >
>  >
>  > THE TITLE OF THIS BOOK
>  >
>  >
>  >
>  > to
>  >
>  >
>  >
>  > The Title of This Book
>  >
>  >
>  >
>  > So. it needs to have some logic, i.e. knows to skip conjunctions
>  > like "of"
>  > and "and" etc.
>  >
>  >
>  >
>  > I can see in the character designer how to change a set of
>  > characters to
>  > small caps, lowercase, or uppercase. Does anyone know of a way to
>  > make this
>  > ability go one step further and become title case?
>  >
>  >
>  >
>  > Tina Ricks
>  >
>  > Editor
>  >
>  > Trial Guides, LLC
>  >
>  > tina at trialguides.com
>  >



More information about the framers mailing list