The enumerator has a method that tells you if any items are left. It's used in literally every example that uses an enumerator.
The collection you're enumerating has a count property which tells you how many items are in it. It's used in the example default script you get when you create a new script button.
Also, if you just want the first file (or first two files, or similar), you can get those directly from the collection without using an enumerator, which makes things a lot easier. Enumerators are generally only needed when you want to loop through the whole list of files.
One cool thing to try: if you go to a "Modifiers" tab in the Command Editor of your script, you can put @disablenoselthere and then the button will not be enabled at all unless something is selected.
It's cool (and I often forget it too!) that we can use modifiers even for the jscript/vbscript buttons (we just have to specify them in a separate place)!