Try sharing a macro from MacroDroid. It always triggers when system dialogIsn't it because (I think) app launched trigger checks what app is in foreground? When dialog appears some system app is in foreground till it disappears, then again youtube is in foreground what causes trigger to fire.