In 1799, just short of his 40th birthday, on 23 May 1799, Rev. Dr. William Moodie was elected Moderator of the General Assembly of the Church of Scotland. It was in the middle of the French Revolutionary Wars and Britain was haunted by the threat of foreign invasion coupled with insurrection at home, particularly in Ireland and in the industrial areas. Dr Moodie presided over a fairly anxious meeting. After congratulating the King on recent naval victories on the Nile and off the Irish coast, the General Assembly expressed gratitude for living in such a free country under so beneficent a king. It deprecated the savage actions of the French Revolutionaries and their attacks on established order and even Christianity itself. The King, in a letter, had asked them to do all in their power to keep their parishioners loyal and virtuous, which they in turn promised to do. They also adopted a "Declaratory Act", against "unlicensed" or "vagrant" teachers of the gospel, especially those teaching outdoors or in unregulated Sabbath schools, where loose talk about democracy and Thomas Paine could lead to trouble. A "Public Admonition" was drawn up, to be read out in every Parish, reminding their parishioners of the happy country in which they are blest to dwell, warning them about the evils of the French Revolutionaries, or of listening to the unlicensed teachers or attending unregulated Sunday schools. A committee reported on a detailed examination of the law, which, it claimed, gave the Parish Minister the right to inspect all educational premises in his parish, including the universities and private or voluntary establishments.