Access the styledRanges in the action while holding the lock.
The action to perform with styledRanges while holding the lock.