“Find one by one” is actually a good way — of course, it depends on how you do that! The findText command is very reliable for these kind of operations, as it returns a complete list of all occurrences of your character style. The only caveat emptor is that the returned list of occurrences is a static copy; that is, if you change something in the text of the first found item, the references to all next occurrences will be off. The common solution is to work backwards through your found list of items (and findText can return the found list in reverse, so you don't even have to run 'backwards').
This is only necessary when you are doing something with the actual text, such as inserting or deleting characters, or adding a hyperlink, XML, anchored object or index marker — these all insert invisible codes into text. It's not necessary when changing formatting, such as adding underline or changing the font.
Here is a sample script that adds underline to all occurrences of a character style (just as a visible example; this could be done better by changing the character style definition!).
app.findTextPreferences = null;
app.findTextPreferences.appliedCharacterStyle = “Emphasis”;
result = app.activeDocument.findText(true);
for (i=0; i<result.length; i++)
{
result[i].underline = true;
}
If speed is of the essence, you could venture into the realm of Advanced Scripting. One of InDesign's most powerful scripting commands is “everyItem”. What does this do? It gathers a list of every item of the kind you give a reference to; and it does so with an astonishing speed as well. When the list is gathered, you can inspect its various properties at leisure and decide what to do with each of the items.
everyItem(), and its often-partner getElements(), is a tough beast to master, and so I would not recommend this for starters :) It took Marc Autret not one but two blog articles to investigate it in full: On 'everyItem()' Part 1 and (no surprise) On 'everyItem()' Part 2. However, just to tease you, here is a variant of the script above that gathers every single formatted text span and then inspects each separate one for your applied character style.
cstyles = app.activeDocument.stories.everyItem().textStyleRanges.everyItem().getElements();
for (i=0; i<cstyles.length; i++)
{
if (cstyles[i].appliedCharacterStyle.name == “Emphasis”)
cstyles[i].underline = true;
}