Accompanied by his wife, he praised the church’s work during the Covid-19 pandemic and its readiness to change.
At the opening of the Assembly, which he attended as Lord High Commissioner, the Queen’s representative, William, known as the Earl of Strathearn in Scotland, told how as a teenager he found comfort in Scotland’s outdoors after being told of his mother’s death while he was staying at Balmoral.
And at the final session he said he had been “shaped” by Scotland.
He recounted the visits he and the Duchess had made during the week, including to Orkney and to St Andrews University, where they first met 20 years ago.
"It was wonderful to be back in St Andrews and walk down memory lane together,” he said.
He spoke of the “inspirational” people they had met around the country and praised the “dedication, commitment and personal sacrifice” of NHS staff whom they had hosted at a drive-in cinema at Holyroodhouse.
"These people make Scotland the vibrant, friendly, innovative and determined place Catherine and I love and is so important to us.
"I am shaped by this place. The abiding affection I feel for it is rooted in my experience of its everyday life, in people, relationships and its ethic of neighbourliness.
“Catherine and I came here to listen so that we might learn more about your challenges but also to learn of your hopes and aspirations so we may serve alongside you with the combination humility and conviction that speaks so powerfully to us.”
And he highlighted the work local churches had done in response to the pandemic.
"Be it the rapid move of services online or pastoral visits to neighbours to help with shopping or collecting prescriptions or support by parishes of their local foodbanks, the church has shown that even in a pandemic, though we may be separated, we need not be alone. So to members of the Church of Scotland I say thank you for the work you’ve done, the witness you have offered and the service you have given during this pandemic.
“Over this past year local communities across the entirety of the United Kingdom have experienced a time of profound loss, challenge and change. But they have fund support in the values of community life that perhaps we may have previously taken for granted.
“These values provide us with the strength and ingenuity to adapt and meet the challenges we face now and ahead – and that is why I believe we can be confident about the future, a future embracing change yet holding those values close.”
In his closing address, the Moderator of the General Assembly Lord (Jim) Wallace of Tankerness referred to decisions made during the week on cutting the number of ministers by a quarter, capping the posts in each area and merging presbyteries.
"None of these were easy decisions and while we had well-argued debate around important detail I did not detect anyone suggesting we simply carry on as before. The Assembly has demonstrated a can-do rather than an ‘it’s never been done this way before’ attitude which must augur well.”