How can I get straight lines on a UV map?
Aside from perhaps some add-on, I'm not sure of a way to do what you want in one action. If you are open to another solution, perhaps consider the align auto function in the UV specials menu. It does basically the same thing as scaling to 0 on X or Y, but can save time as you can just use Shift+R to repeat the operator after using it. 

Just Altselect your edge, and then use W>A(Align Auto) to activate the operator, followed by Shift+R after each selection to repeat the function.