You can register for a free account for ToS to access its paper trading account. Then, you can use the paper trading account on ToS desktop. If you have time (which shouldn't be too long), I'd suggest that you register one. This will make sure that you can make the macro works correctly with the actual ToS app.
You didn't actually indicate when you want to stop,
I just scroll down until the last expiration date then click each options until the last option. Then, I am done.
P.S. When I looked at the number of entires in each block of items, the number of rows per block ranged from 15 to 778.
I don't think there are so many rows in an expiration date. Usually, there are tens to a few hundred options for a stock. So if you have a few clicks for a stock, then there will be a few hundred to a few thousand clicks for all the options of a stock. It is OK for now. I will see how it works in practice once the macro works.
I've created macros that tell the user (either by sound or pop-up message) to move the mouse to the "start location" and leave the mouse there for a second.
I want to completely avoid human interaction. So asking the user to point the mouse somewhere is not an acceptable solution.