How to Run Shell Script upon Application Launch?
The third-party UI-scripting application Keyboard Maestro (KBM) can perform this function. (Along with many others.)

I've been using KBM for 5 or 6 years, it's very stable and reliable.

See screenshot of sample KBM script: