With its asbestos roof, bland exterior, dirt floor and wooden pens, the old auction mart in the Sutherland village of Rogart seemed to have little going for it.

The farmers and their sheep had long since moved on, the bustle of market day well past and the mart, amid a patch of scrubland, had seen better days.

Passers-by may well have seen an eyesore. For locals, however, the building’s weathered exterior represented generations of fond memories.

Having seen one effort to flatten it for housing fail, they resolved not to let their little piece of local heritage go.

A few weeks ago, their efforts were rewarded when Rogart Mart was again packed with people; this time not for a sheep sale but arts, crafts, treats and trinkets.

Reborn after a mammoth community effort, the building has been spruced up, the seating area made good and outside scrub cleared and landscaped.

While on the interior walls are dozens of old pictures that show the craggy-faced farmers and the buyers who once gathered under roof – poignant reminders of times and people now long gone.

“People walk in, they see the photographs on the walls and recognise the faces,” says Kate Roach, Project Coordinator of Rogart Development Trust.

“In its heyday, they were selling 20,000 sheep a day here, people came from all over and it was a huge social event.

“This is our heritage, and the building retains these memories for everyone.”

Built to meet demand from local farmers in the 1930s and closed in 2001 after the foot and mouth crisis meant its was no longer suitable for use, its supporters say it tells its own story of Scottish life.

In saving it, the Rogart community has joined countless others who are playing an increasingly important role as unofficial keepers of Scotland’s rich social history.

Rather than see old buildings deemed not significant enough to be saved from development, boarded up by cash-strapped local authorities or, worse, demolished, community groups across the land have taken matters into their own hands.

And as a result, they have become almost accidental custodians of the nation’s heritage.

The buildings they save range from old town halls no longer needed for council business, to grand historic homes steeped in history but which seemed set to fall into private hands.

One community has taken over a grain mill which at had looked like it might never turn a wheel again, another is caring for a 13th century castle.

Communities have taken on old Victorian schools, at least one Edwardian police station and, on the Isle of Canna, a picturesque but ‘at risk’ old barn.

Dating from the late 18th century, the two-storey Coroghan Barn was once used to store grain and livestock awaiting transportation.

Although owned by the National Trust for Scotland it had fallen into a miserable condition. Now the Isle of Canna Community Development Trust wants to revive it as a workshop, community space and bunkhouse.

According to Gordon Barr of the Architectural Heritage Fund, which supports communities as they take their early steps into taking over old buildings, a growing number of communities are no longer prepared to wait for other bodies to save their local built heritage.

“Our architectural heritage covers a lot more than ‘just’ castles and country houses, as important as those are,” he points out.

“Our ‘real’ heritage is often our homes, our places of work, our places of leisure.

“The buildings and environments that we use and surround us in the everyday, not just somewhere to visit on a special occasion.”

He says the AHF is supporting up to 70 community groups each year.

Often the buildings they seek to take on may not be of major historic significance but are so interwoven in local life and with their own stories of history and heritage, that losing them would be a tragedy.

Some are particularly quirky, such as in Langholm, where the Eskdale Foundation took on the Edwardian B-listed former police station and converted it into affordable and accessible housing.

“The project has resulted in the retention of the old station’s original features,” he adds. “In one flat, the bathroom door is the old police cell door.”

In Oban, Rockfield School, built in 1894, was earmarked for demolition when locals persuaded the local authority to transfer ownership to them. It reopened last summer as a multi-use, all-weather community hub with heritage centre.

At the other end of the scale in Annan, a local group is working to transform the historic harbour into a visitor hub combining natural and cultural heritage and supporting recreational and commercial boating activity.

“It’s the sheer ambition of that project that amazes us,” adds Gordon. “The idea of giving the public access to the historic harbour that’s never been available before, is really exciting.”

In Kilmarnock, a group wants to save a late 19th century ‘Old Men’s Cabin’ in a local park, built to give war veterans a place to socialise which ended up used as a council storage facility and boarded up.

It is dwarfed by ambitious plans by the community group which now runs 17th century Bannockburn House near Stirling. Once used as a headquarters by Bonnie Prince Charlie, it was set to be sold when they stepped in with plans for event space, housing and community gardens.

Even castles are being taken over: in Dundee, A-listed Dudhope Castle, parts of which are 13th century, is in the hands of social enterprise group The Circle who plan workspaces and events within its ancient walls.

Some buildings have deep ties to their community: in John O’Groats, locals were determined an old grain mill – among the last of what was once a common feature of the Caithness landscape – should not be lost.

“There was a huge milling industry in the area, but by the 20th century a lot had become redundant,” says Bryony Robinson of John O’Groats Mill.

“The mills were places where people would meet and socialise. They were warm in winter when it was dark and rainy, and with few places for people to gather.

"You can see graffiti on the walls scratched there by people from years ago.

“Many people have memories of the mill and when the last miller died around 20 years ago, the community wanted it to become a local asset and not just crumble and disappear.”

It will become a meeting place, visitor attraction with working mill and training facility to pass on long gone mill skills.

Among the latest projects to receive AHF support has helped to ensure the town hall at the centre of civic and social life in New Galloway since the 17th century is saved.

“It was at a crunch point where the council said if a local group didn’t take it over and manage it, it would be boarded up and we feared it would go to wrack and ruin,” says Ann Glaister, of Local Initiatives in New Galloway (LING), which has just taken over the building.

“People realise councils can no longer keep these buildings, and rather than see them lost, they are taking responsibility.”

The move paves the way for £300,000 of refurbishment works and a range of innovative new uses for the old town hall, hopefully for generations to come.

“It’s not about nostalgia or saving a building for its own sake,” adds Gordon.

“It’s about what can these historic buildings do to help the communities and places they are based in.”