Robert Ainslie was a Scottishwriter and a correspondent of Robert Burns, the poet. He was born 13 January 1766, at Berrywell, near Dunse, where his father was factor to Lord Douglas. While apprenticed to a writer to the signet in Edinburgh, young Ainslie in 1787 formed the acquaintance of Burns, and in May of the same year he made an excursion with the poet in Teviotdale and Berwickshire. Burns stayed some days at Berrywell. A sister of Ainslie, whom Burns met on this occasion, was the subject of the impromptu beginning with ‘Fair maid.’ Ainslie passed writer to the signet in 1789. He became an elder in the Church of Scotland, and was the author of two small religious works, ‘A Father's Gift to his Children,’ and ‘Reasons for the Hope that is in us.’ He also contributed to the ‘Edinburgh Magazine’ and other periodicals. His intimacy with Burns, and his genial manners, secured him a cordial welcome in the literary circles of Edinburgh. Hogg, who speaks of him as ‘honest Ainslie,’ mentions, as his one failing, constitutional sleepiness, the irresistibility of which Hogg, with characteristic egotism, illustrates by stating that he has ‘seen him fall fast asleep in the blue parlour at Ambrose's, with North in the chair and myself croupier.’ Fourteen letters of Burns to Ainslie are included in the poet's correspondence. According to W. S. Douglas, the ballad, ‘Robin shure in Hairst,’ refers to a juvenile amour of Ainslie. Ainslie presented Sir Walter Scott with a manuscript copy of ‘Tam o' Shanter,’ which he had received from Burns at Ellisland. He died on 11 April 1838.
Ainslie was Initiated into Scottish Freemasonry in Lodge Holyrood House, No.44, on 12 December 1783. When he became acquainted with the Scottish poet, Robert Burns, in 1787, both therefore had a mutual interest - Scottish Freemasonry. Burns had been Initiated in a Masonic Lodge in Tarbolton, Ayrshire, in 1781. When travelling together on their Border Tour in May 1787 they attended the Masonic Lodge in Eyemouth, Berwickshire, when both were Exalted into the Holy Royal Arch.