Martin McNally's behaviour towards the woman was "deeply disturbing, controlling and unpleasant", a sheriff said.