I know onClose{} is available for the .menu file. So you say there is a onOpen{} as well?
If that is true then that is the solution for my problem.

Cheers buddy!