There is not a single person amongst my direct ancestors who was born outside of the UK, so the short answer to “what language did they speak ?” is pretty simple: English !
The exception to this may be those who were born in Aberdeenshire in the 18th and 19th centuries, although even here it is hard to be certain. My initial thought, as an ill-informed southerner, was that they would have been Gaelic speakers since this is generally considered to be the native Celtic language of Scotland, but it seems that this was probably not the case.
Although the names of places such as Peterhead, Cruden and Fraserburgh clearly have Gaelic roots, researchers have suggested that as early as the 15th century those in eastern Aberdeenshire actually spoke Early Scots, which was a Germanic language that shared its Anglo Saxon origins with Old English.
Just as Old English became the Modern English we recognise today, in the 17th Century Early Scots became Modern Scots. The two are now considered to be sister languages but, although it still recognises Scots as a separate indigenous European language, UNESCO now deems it to be vulnerable due to the seemingly inexorable shift towards “standard” English vocabulary.
Even if my distant ancestors were Gaelic speakers at some point, after the Battle of Culloden in 1746 there was a concerted effort to impose the English language on the Scots as a means to subdue the population, and by 1891 just 6.8% spoke Gaelic, most of them located in the Highlands and Islands far from lowland Aberdeenshire.
Those in my tree who attended school in Scotland in the 19th century were certainly taught in English – the New Statistical Account for Aberdeenshire, which dates from 1845, records that there are “only four or five persons between six and ten years of age who have never been at school” in the parish of Lonmay, where the Clark family lived, and reveals that the pupils are all being taught English reading, grammar and writing.
Despite their English formal education, one thing that I can be sure of is that my Clark and McDonald ancestors will have conversed in Doric, which is an Aberdeenshire dialect that has such distinctive pronunciation, grammar and vocabulary that some argue it should be considered a language in its own right:

This extract from the satirical novel “Johnny Gibb of Gushetneuk” was written by William Alexander, an Aberdeenshire journalist and author, in 1869. Set in the fictional parish of Pyketillim in the 1840s, the story relates the petty local politics involved in the struggle for control of the Church of Scotland and, in parallel, the contest between lairds (landowners) and their muckle (small) farmers for control of the land. The novel opens with the above exchange in Doric between Johnny and his hynd (foreman), Tam Meerison, as they load up their cart for a restorative trip to the Wells at MacDuff, where they hope to benefit from the bracing effects of sea bathing.