I need to use shell to open an application only if the application is not already open.

If the user tries to open it when it is open it should be ignored whereas right now it'll open another window with the application.

Anyone know how??