Pan to selection in InDesign

I’m writing a script to find short streaks of different formatting (an italicized comma in a non-italicized sentence, etc.). I have a dialog to jump between found instances, and I would like the view to follow in the same way that it does when searching with the built-in Find/Change tool. The instances get selected but I haven’t been able to figure out how to pan the view to selection.