It sounds like writing down names is similar to a coping strategy. I know there's definitely good resources online or apps that can give you ideas for distractions or coping mechanisms. Personally, I've had good luck with trying new distractions and not keeping the same method for too long. I'd say look into more strategies and coping mechanisms, just to help you focus on something else.
Either way, obsessive thoughts aren't fun, but we're rooting for you here!