Hello Melissa,
It is not possible to know how many objects are selected when running a Custom Action. However, there is a workaround - you can create a Custom URL Field that contains a link to that Custom Action that is internal (not otherwise visible in the interface). This would make it impossible to run that Custom Action on multiple items.
Please let me know if this helps.