That's because a program does exactly what it is designed for and nothing more. If it should handle single and multiple selected items, the code should be changed so it can handle that. In this case you should probably add a check to make sure every selected item is a dimension and then create a "for" loop that changes each selection item.
What do you have now?