If two are selected then do this

Say I wanted to select two objects so that did a certain action.
How would that If statement look?
Any help will be greatly appreciated.

~Zach