"You can only leave your accommodation in limited circumstances. These include where:
you need to travel to leave Scotland, provided that you do so directly
you need to seek medical assistance you need access to basic necessities like food and medicines (including for any pets or animals in the household), but please try to first arrange for these to be delivered to you instead to reduce the number of times you need to leave your accommodation
you need to access critical public services such as social services and victim support services, but only in exceptional circumstances
on compassionate grounds where you need to go to the funeral of someone in your household or a close relative, or where no-one else is attending a friend. Further advice on funerals.
you need to fulfil a legal obligation such as participate in legal proceedings
you need to access public services (including social services or victim services) where access to those services is critical to your wellbeing and cannot be provided at your accommodation
there’s an emergency which puts you at risk in your accommodation"
https://www.gov.scot/publications/coronavirus-covid-19-public-health-checks-at-borders/pages/self-isolation/