running a shutdown script with kodi

Hello all,

longitme user all the way back to boxee days. Anyways, i finally got around to serial controlling my projector from the command line. I run a batch file the projector turns on and off. I also may want to run some autohotkey macros controlling IR blasters and the like.

How do i get it so that when i go to “shutdown system” and only at that menu option, a script runs that i desire?

Is there any scripting on the startup of kodi, or adding a button to the UI that calls a batch file or script, or runs a program? I dont want to edit core code that will be replaced. Any help appreciated. thanks.