Is it modified?
I cant see "alert" part of code on my side (CS5). Script "do nothing" if cant do something.
Paste function main() content here
@perfectdeb – what version are you using?
What exact version of InDesign?