Actually, there is a way if you can program in some scripting language.
The radio control interface uses the hamlib network protocol but it has been extended to send "AOS" and "LOS" strings whenever these events occur. This is used in gqrx to start and stop the audio recorder.
It requires gpredict devel code from git. There you find the option under radio interface settings.
Take a look at it if you are interested and don't hesitate to ask if you have questions.