Scottish wills and testaments were usually recorded in the courts which had jurisdiction over the district in which the deceased person had lived. These districts reflect old administrative areas in Scotland.
The Commissary Courts registered wills up to 1823, and thereafter the Sheriff Courts took over this function. However, there is a considerable overlap of dates in some courts, so it is always advisable to check both courts for wills between 1804 and 1829. The number of Sheriff Courts was greater than the Commissary Courts. Go to Research Tools to see how they matched up in area.
If the person you are looking for died abroad the most likely courts to search are Edinburgh and non-Scottish courts. Between 1858 and 1900 the non-Scottish Courts have fuller versions of these wills.
To find out how Scotland's counties matched up to the court boundaries move the mouse over the map for more information.