First check if frontmost, then tell System Events