Craft gloves and place them in dispensers to simulate left and right clicks.
Phantom Gloves have slightly extended reach, allowing dispensers to click things that are one block further, even if there is an obstacle in the way.