Create a trigger for three finger drag

I am trying to create a macro that starts a program when I start a three finger drag and then closes it when I finish the drag and lift my fingers. I have the second part down but I can't figure out a way to trigger at the start of the drag. The below image is the closest I've come, It does what I want when I hold down a click, but I need to somehow have it trigger when I start a three finger drag. Any help would be appreciated.

Further, is there any way to have some type of script that monitors the system for when something is being dragged? I need this program to only be active when dragging.