Script to select only horizontal objects or vertical

Hellow! Pliz help! I have screenshots:..

I need little script. First button to select only vertical object and second button to select only horizontal objects.

AttachmentSize
002.jpg279.01 KB
003.jpg284.26 KB