The Assembly sent congratulations to the Duke of York on his marriage to the Princess of Prussia and approved measures to promote the Protestant religion in the Highlands and Islands of Scotland (this was an annual measure, drawing upon funds specially donated by the Crown). In the year following he declined the customary appointment as one of His Majesty's Chaplains in Ordinary. In 1783 he was a founding fellow of the Royal Society of Edinburgh (and of its predecessor, the Newtonian Society). He took part in its deliberations, though not always successfully. He once turned up to give a talk, with a mass of papers under his arm, announcing he would deal with twelve topics. The "Preses" (chairman) said he had twelve objections to this, and took some time to deliver them, followed by six members who took it in turn to add their objections. Dr Hunter listened glumly throughout the evening, then gathered his papers together and left in silence. Andrew Hunter died at his home at the head of New Street on the Canongate in Edinburgh on 21 April 1809. He had collapsed suddenly "with an inflammation" after having returned from a Holy Fair (regional Communion Services) in Leith. He died after a few days illness, calmly assured of a future life. He is buried in Canongate Kirkyard on the Royal Mile. On 14 April 1779, he married the Hon. Marion (aka Mainy or Mary) Schaw Napier (born 5 Aug. 1756, died 9 Oct. 1806), the eldest daughter of William Napier, 7th Lord Napier, with whom he had three sons and three daughters. His daughter Grizel (aka Grace) Hunter (1784-1864) married George Ross advocate, third son of John Lockhart-Ross baronet. He was cousin to James William Hunter FRSE.