The Master of Works to the Crown of Scotland was responsible for the construction, repair and maintenance of royal palaces, castles and other crown property in Scotland. The main buildings were; Holyroodhouse; Edinburgh Castle; Stirling Castle; Linlithgow Palace; and Falkland Palace. The position was roughly equivalent to that of Surveyor of the King's Works in the English Royal Household. The emergence of the position reflected a shift in responsibility from the masons, or administrators in holy orders, to designers with little hands-on knowledge of stonemasonry. Earlier holders of the office were often courtiers: James Hamilton of Finnart was the king's kinsman; John Scrymgeour was a heraldic expert; while William Schaw, an administrator, was a key figure in the development of Freemasonry, itself a 'craft' having little to do with building. Later holders filled a role similar to that of architects in the modern sense. Some Masters were craftsmen; Robert Robertson, who was master of work at Stirling Castle after the execution of the aristocrat Hamilton of Finnart, was a carpenter. During the reign of James V there was also a Principal Master Wright or carpenter, John Drummond of Milnab, and as well as building works he was concerned with the artillery and its logistics.
In the 15th century, a Master of Works would be appointed to oversee an individual construction project, such as a new palace, or a rebuilding of an old one. Thus the exchequer records identify several postholders who might be regarded as accountants rather than architects. In the 16th century, during the reign of James V, the appointment of a Principal Master of Works began, with overall responsibility for all the king's works. The appointment was usually for life. Following the death of James Smith in 1714, the post became a sinecure, with a salary of £400, and the post declined in importance. In 1808 Robert Reid was named Architect and Surveyor to the King in Scotland, and he became Master of Works following the death of James Brodie in 1824. However, in 1831 the Scottish Office of Works was merged with the English Office of Works, and when Reid retired in 1840, he was not replaced. The Office of Works was later reconstituted as the Ministry of Works.
Principal Masters of Works to the Crown of Scotland 
The dates given are those of their appointment. These appointments were made by the issue of a warrant recorded in the Register of the Privy Seal. William MacDowall, though acting as master of work never had a warrant, and some appointments ran concurrently.
- 1529: Sir James Nycholay, or Nicolson, Master of Work at Stirling Castle.
- 1537: John Scrymgeour
- 1539: Sir James Hamilton of Finnart
- 1541: Robert Robertson (Principal master wright in Stirling Castle)
- 1543: John Hamilton of Milneburn
- 1579: Sir Robert Drummond of Carnock
- 1583: William Schaw
- 1602–1607: Sir David Cunningham of Robertland, also Surveyor of the King's Works in England, 1604–1606.
- 1607–1634: Sir James Murray of Kilbaberton
- 1615: Walter Murray (Assistant Master of Works)
- 1629–1637: Sir Anthony Alexander
- 1632: William Govane of Cardrona and James Murray Jr. (Assistant Masters of Works)
- 1637–1641: Henry Alexander, 3rd Earl of Stirling
- 1641: Sir John Veitch of Dawyck
- 1643–1644: John Carmichael
- 1645–1649: Sir David Carmichael of Hyndford
- 1649: Sir Robert Montgomery
- 1660–1668: Sir William Murray of Dreghorn
The office was unoccupied from 1668–1671.
- 1671–1678: Sir William Bruce of Balcaskie, Baronet
- 1678–1683: David Maitland (acting Master of Works)
- 1683–1788: James Smith
- 1689–1700: Sir Archibald Murray of Blackbarony, Baronet
- 1700–1704: James Scott of Logie
- 1704–1705: Sir Francis Scott of Thirlestane
- 1705–1714: John Campbell of Mamor
- 1705–1717: John Urquhart of Meldrum
- 1707–1714: James Smith (position renewed)
- 1717–1743: Sir John Anstruther of Anstruther
- 1743–1761: George Dundas
- 1761–1764: William Stewart of Hartwood
- 1764–1768: James Duff, of the Middle Temple, London
- 1768–1809: Lieutenant-Colonel James Pringle
- 1809–1824: James Brodie of Brodie
- 1824–1840: Robert Reid
- Colvin, p1155
- Glendinning & McKechnie, p.66
- McKean, Charles (2001). The Scottish Chateau. Sutton Publishing. ISBN 0-7509-2323-7. p.158.
- Colvin, Howard (1995). Biographical Dictionary of British Architects, 1600–1840. p. 1155. ISBN 0-300-06091-2.
- Glendinning, Miles; McKechnie, Aonghus (2004). Scottish Architecture. Thames & Hudson.
- Mylne, R.S (1896). "The Masters of Work to the Crown of Scotland, with the Writs of Appointment, from 1529 to 1768". Proceedings of the Society of Antiquaries of Scotland 30: 49–68. Retrieved 2007-05-30.
A portion of the proceeds from advertising on Digplanet goes to supporting Wikipedia.