He was the third and youngest son of George Ainslie, Esq., the representative of the ancient Scottish family of Ainslie of Dolphinton, Lanarkshire, chief of the name, who married Jane, daughter of Sir Philip Anstruther of Anstrutherfield, and died in 1733. The issue of the marriage of George Ainslie was a family of seven children, and included four daughters, three of whom were married and established in France. The elder brothers of Ainslie were Sir Philip Ainslie, knight, who was born in 1728, and died on 19 June 1802; and George Ainslie, a general in the army, colonel of the 13th regiment of foot, and lieutenant-governor of the Scilly Islands, who died on 7 July 1804. Ainslie, who was born either in 1729, or most probably in 1730, is described as having resided in the earlier part of his life at Bordeaux, where his father had been for some time settled as a merchant. He is said to have returned to Scotland in 1727, and to have purchased the estate of Pilton, in the county of Midlothian.
Ambassador to Turkey
Ainslie is first noticed in the London Gazette on 20 September 1775: "The king has been pleased to appoint Robert Ainslie, Esq., to be his majesty's ambassador to the Ottoman Porte, in the room of John Murray, Esq., deceased; and his majesty was pleased this day to confer upon him the honour of knighthood, upon which occasion he had the honour to kiss his majesty's hand." He left England in May 1776 for Constantinople, where he arrived on 2 October following. Ainslie had the reputation while in Turkey of being a great favourite and boon companion of the Sultan Abdul Hamid I. He returned to England in 1791. He was given leave to return home on 22 September 1793 and left Turkey sometime in 1794.
MP
On 8 September 1796, Ainslie received a grant of a pension of £1,000 on the civil list, to be held ‘during the joint lives of his majesty and himself’; and was elected a member of the parliament which met on the 27th of the same month, with Lord Paget as his colleague, for the close borough of Milborne Port, Somerset. At the general election of 1802, his seat in parliament was transferred to Hugh Leycester. He was created a baronet, of Great Torrington in the County of Lincoln, on 13 October 1804, with remainder, in default of issue male, to his nephew, Robert Sharpe Ainslie, son of General George Ainslie. The Gentleman's Magazine for December 1796 records the death of his son on 20 December 1796 from a violent fever. His great-nephew was Thomas Corbett. Ainslie died after a long illness aged 83 at Bath, England, on 21 July 1812.
Numismatics
Ainslie took advantage of his position at Constantinople to amass a collection of ancient coins from Eastern Europe, Asia Minor, and the north of Africa. The most characteristic were described by Abate Domenico Sestini, who dedicated to Ainslie a work which has gone through several editions, entitled Lettere e Dissertazioni Numismatiche sopra alcune Medaglie rare della Collezione Ainslieana, 4 vols. 4to, Leghorn, 1789–90, a fifth volume of which, with the enlarged title e di altri Musei, appeared at Rome in 1794, and four others, referring to particular collections, were published at Berlin in 1804–6. Sestini continued his exposition of the Ainslie collection in a smaller work, and more special in its scope, entitled Dissertazione sopra alcune Monete Armene del Principi Rupinensi della Collezione Ainslieana, 4to, Leghorn, 1790. This work is at present bound up with a copy of the first four volumes of the Lettere e Dissertazioni, which, according to an inscription, probably autographic, on the fly-leaf, was "presented from Sr Robt Ainslie, June 5, 1795," to the British Museum. Another volume of Sestini's is entitled Descriptio Numorum Veterum ex Museis Ainslie, Bellini, Bondacca, Borgia, Leipzig, 1796. Ainslie had been the ‘Mæcenas’ of Sestini's dedication of the Lettere e Dissertazioni of 1789; seven years later, in the preface to the Descriptio, he was a malignant speculator and trader in antiquities.
Research and commissions
Ainslie's researches embraced antiquities of various kinds, objects of natural history, and illustrations of the East and its current life. Ainslie was a friend of important German orientalist artist Luigi Mayer and before departing Turkey travelled with him along the coast. He commissioned Mayer to produce drawings of many landmarks en route include the former settlements of ancient Lycia, such as The Harbor At Cacamo and ancient Telmessus. Mayer also drew other places in the Eastern Mediterranean and the Balkans for Ainslie and in his time visited Wallonia, the Ionian Islands and Egypt, all documented in his paintings. Three volumes of drawings were published, in the words of the dedication, ‘under his auspices.’ The first of these is entitled Views in Egypt, from the original drawings in possession of Sir Robert Ainslie, taken during his Embassy to Constantinople by Luigi Mayer; engraved by and under the direction of Thomas Milton; with historical Observations and incidental Illustrations of the Manners and Customs of the Natives of that Country, eleph. fol. London, 1801. This was followed by two bilingual volumes, English and French, entitled Views in the Ottoman Empire, chiefly in Caramania, &c., 1803; and Views in Palestine, &c., 1804. The coloured plates in these volumes are ninety-six in number; and fifty-four were afterwards given in the first edition, and seventy-one in the second edition, of Views in Turkey in Europe and Turkey in Asia, London, 1810. A selection from all these appeared in 1833 as a group of engravings, uncoloured and of smaller size, with the title of A Series of Twenty-four Views illustrative of the Holy Scriptures.