Scottish children were often named after grandparents and relatives as a way of passing down a family name through the generations. This tradition occurred mostly during the 1700s to the 1800s until it gradually died away in the late 1800s. Though the naming tradition was not an ironclad rule, it was used extensively. There was a typical order in which the names were assigned, though exceptions occurred often.
The first son was traditionally named after the father's father. The second son was named after the mother's father. The third son was named after the father. The fourth son was named after the father's oldest brother. The fifth son was named after the father's second oldest brother or the mother's oldest brother. If more than five children were born, the other children were usually named after uncles, cousins or whomever the parent chose.
The first daughter was named after the mother's mother. The second daughter was named after the father's mother. The third daughter was named after the mother. The fourth daughter was named after the mother's oldest sister. The fifth daughter was named after the mother's second oldest sister or the father's oldest sister. Sometimes these orders were reversed when the first daughter is named after the father's mother. If this is the case then the male names would be reversed too so that the first son is named after the mother's father.
In second marriages where the first wife passed away, the first daughter born was named after the first wife using the full name. The same went for widows who remarried and had more children. In second marriages that were the result of divorce, the naming tradition started over. This sometimes resulted in half brothers and half sisters having the same names. To avoid this, sometimes parents in second marriages would skip ahead in the naming order until they found an unused name.
Exceptions occurred when there are similar names on both sides of the family. For example, the first son was named after the father's father and the second son was named after the mother's father. If both parents have fathers of the same name, then the order was skipped and the second son is named after the father of the child. If a parent died before the newborn child was baptized, the child was usually named after the deceased parent. If a child died, the child's name was often reused for the next child born.