A former senior manager at STV has been chosen Rector of the University of St Andrews.
Alistair Moffat is also a former director of the Edinburgh Fringe.
He was up against four other candidates, including former BBC Scotland broadcaster, Abeer Macintyre, and former-footballer-turned-pundit, Pat Nevin.
Since leaving STV in 1999, Moffat has served as director of the Borders Book Festival and Lennoxlove Book Festival, both of which he also founded. At STV, he held the posts of programme director and chief executive of network production.
The Rector acts on behalf of the students and chairs the university court, its supreme governing body.
Almost half the students took part in the vote.
Scotland's ancient universities – St Andrews, Edinburgh, Glasgow and Aberdeen – have a rector, as does Dundee.
The previous rector of St Andrews was Kevin Dunion, the Scottish information commissioner.
Peter Pan author J M Barrie, Jungle Book creator Rudyard Kipling and comedian John Cleese have also held the post.
Almost half of the electorate turned out to vote in the latest poll, which was conducted using electronic voting.
Mr Moffat, who was a former director of programmes at Scottish Television, graduated from St Andrews in 1972.
He said: “When 600 years ago the candles of enlightenment were first lit in St Andrews, they shone light into some dark corners.
“Now cold winds are blowing and storms gathering out there and the candles are flickering and growing dim.
“But what is wonderful about St Andrews are its students, and with their energy and commitment, St Andrews will burn brightly again without a doubt.”
Students' Association president Patrick O'Hare said: “This election has been a triumph for student democracy – a turnout of 49% is a remarkable statistic and demonstrates once again how much the students of St Andrews value the important position of Rector and the place of student activism.”