@juliansader,
Thank you so much!
The way I was doing this before was with AHK which was way easier to program.
I would then use lua to execute the AHK script via a midi command, however this is way better from an organizational standpoint., one less script to keep track of.
By the way is there any way to manipulate the transparency of non-script windows with your extension?