You put this code in an Action? Then of course it will show the alert... You have the the original file open, and then the files you're processing using the Action. Also, Acrobat sometimes doesn't close the files it is processing correctly and the last one usually remains open at the end of the Action.
It works fine for me. I make sure no pdf's are open. Then I double click on the 1st desired pdf in my sequence. Then I go to Tools>Action Wizard>Batch Labeling App and run. I get no errors.
For some reason, this user is saying they get errors even though they are making sure no pdf's are open except this initial one from which they launch the action wizard.
Does this change your answer?
Note the additional files in the action are hidden. They never open. This is why I never get an error. The idea was to only give user this error if they had multiple pdf's open, then tried to run the action from one of them. I knew this would be bad news so wanted an error for this case. I even tested this with the code by creating this scenario (multiple pdf's open) and was very happy the error came up.
What is puzzling is that this error is coming up for this user even though only 1 pdf open. This makes no sense.