The independent future of the school was threatened by the Education (Scotland) Act 1872, which made education compulsory and took over the running of parish schools from the Church of Scotland. Burgh as well as parish schools now came under school boards run by local committees, and similarly ancient schools in Edinburgh and Glasgow were taken over by their respective town councils. The Subscribers to the High School objected to this. The situation was worsened by a similar Act in 1878, and legal action looked inevitable, until an alumnus, William Harris, offered, in February 1881, to donate £30,000 for the purposes of higher education in Dundee on condition that the board give up all claim to the school. This agreement was incorporated in an Act of Parliament, the William Harris Endowment and Dundee Education Act, 1882. This act led to the appointment of a single rector of the High School of Dundee, and the foundation of Harris Academy. Thanks to Margaret Harris, who waived her right to a life-rent of her brother's estate, a girls’ school was built across Euclid Crescent in two stages between 1886 and 1890. A further Act was passed in 1922, and the school's current constitution is embodied in ‘The High School of Dundee Scheme, 1987’, sanctioned by an Order of the Court of Session made under the Education (Scotland) Act 1980, in May 1992.