Scottish advocate and judge who served as Solicitor General for Scotland from 1789 to