Sdl.EditorOperations.Sample BUG

Hi,

By using Sdl.EditorOperations.Sample (C:\ProgramData\SDL\SDK 3.0\StudioAutomation\Sdl.EditorOperations.Sample) plugin, I'd like to find a string within target  text and replace all occurrences but it's not working.

                //traverse in an updatable mode the segment pairs and perform replace
                doc.ProcessSegmentPairs("Find and replace",
                    (segPair, eventArg) =>
                    {
                        foreach (IAbstractMarkupData markupData in segPair.Target)
                        {
                            var text = markupData as IText;
                            if (text != null)
                            {
                                text.Properties.Text =
                                    text.Properties.Text.Replace(findText,
                                                                    replaceWith);
                            }
                        }
                    });

Is the above code correct?  Can the code update target text?

Thanks.

HIroshi Kameya