I have a few documents where the main body text is in Normal style. I need to convert them to a Body Text Indent style, which is easy enough to make a macro for.

Where I'm stuck is that the first paragraph of each section of body text should not be indented. (It should be in a style called Body Text.) In other words, following any style that is not Body Text Indent, I need to apply Body Text to look Like this:

Hello Todd,
Assuming you want hints about how to solve this rather than a fully written out solution, let me suggest this.
Start by giving all Body Text the same style. If you select these, then you will have an array of selections. The index/location of each selection block is the index of the first paragraph in that block, i.e., the ones you want to apply the "no-indent" style. You can go through them in turn, or use the macro language to create a non-contiguous selection for these paragraphs.

You can go through them in turn, or use the macro language to create a non-contiguous selection for these paragraphs.

Although a macro could apply and fix styles paragraph by paragraph, working its way through the document, it's going to be more efficient to reformat everything at once. In other words, your macro will be much faster if you can create a single multi-part selection that includes all target paragraphs, and then apply the desired style in a single action.

That doesn't mean the macro can't still identify target paragraphs one at a time. You can build the list of targets using a strategy that maybe looks something like this:

However, if your macro can avoid a loop like that completely, that's going to be the very fastest. For example, selecting all paragraphs using the "Normal" style (so as to convert them to "Body Text" style) can be achieved using a single find command.

This macro will use the style name to find all blocks with Normal style. Then it selects just the first paragraph of each block. Now apply Body Text. Then apply Body Text Indent to the remaining Normal style paragraphs.