AT the back of St Mary's Roman Catholic Cathedral in Edinburgh, there is a book in which people write requests for prayers.

Many recent messages have asked people to pray for Cardinal Keith O'Brien. "He is a good man," notes one. Events of the past week – including the Pope's departure and allegations about O'Brien – have provoked a maelstrom of confusion, hurt, defiance, denial and pain. Here, in O'Brien's diocese, feelings are acute. "We've never had any scandals in our diocese," says Marie Louise Cochrane, a lifelong Catholic who once worked with the Cardinal. "There have been all these things going on in other places and this is the first time it's been here."

Some appear to feel under attack. Cochrane notes that, for many in the church, "having our leader Cardinal O'Brien's integrity questioned is threatening ... He is a beloved authority figure. Although I don't personally revere the Cardinal, I respect him and I would assume that he was really doing his best. So it is saddening if there is some question about integrity".

Paolo, a young Catholic attending mass at St Mary's Cathedral on the last day of Pope Benedict's office, is fatalistic, believing the future is in God's hands: "I think what has happened probably was meant to happen for the church, to purify it of all the wrongs it has done."

The last decade has seen many controversies, not least the scandals of child abuse by priests, and also a church at odds with some of the prevailing movements and practices of the times such as same-sex marriage, contraception and abortion. Many liberal Catholics therefore feel at odds with some of the rules they are asked to abide. Others seem willing to stick with their church through thick and thin.

"I come from a Catholic family, going back generations," one worshippers tells me. "You're a Catholic till you die," says another. "I've looked at other churches," says Cochrane. "I don't think any other church is better. They all fail."

This is, as one Catholic said, truly a "very broad church".

Another worshipper Eric Woehrling, an investment manager, talks of a "big movement amongst the priests and amongst the faithful" who are in favour of contraception, married priests and women priests. Woehrling is divorced, and notes that his local priests have chatted warmly about his ex-wife (a non-Catholic), visited her home and spoken to her. "It wasn't taboo to talk about the fact that my wife and I are divorced."

Many in the church use contraception – a survey conducted five years ago found that around 70% had used condoms or were happy with the idea of their use, and 55% (higher than the average in the general population) used the contraceptive pill. Cochrane notes that, in the 1960s, some people left the church because they could not abide by its teaching on contraception. Ironically, she says, some returned after the menopause, when it was no longer an issue. "It's the same with divorce. People know people who are divorced and think, 'Why should they be cast out?'."

One of the most contentious issues is the church's attitude towards homosexuality and gay marriage. Many Catholics, like Stirlingshire-based Charlie Gracie, have gay friends and view equal marriage in a positive light. But others consider homosexuality sinful or "unnatural" and believe that, as O'Brien put it, "gay marriage is a grotesque subversion of a universally accepted human right". When someone at Gracie's church asked if he would sign a petition in support of "family life" – a campaign essentially against gay marriage – Gracie replied: "I'm not going to do that." Asked why not, he said: "Well, I don't agree with you. I support gay marriage." An amicable discussion followed and others joined in. "In that debate," says Gracie, "there were a number of people who were holding the church's party line and a number who were questioning it. There were others who nipped out and avoided the debate. I think that reflects the reality of the church."

The way people experience their Catholicism is also informed by where they come from. At St Mary's Cathedral, Lucia, a Slovakian, recalls that in her home country she was surrounded by "strong believers". Sometimes she is surprised by the degree of antagonism in our culture towards her moral views. "I once went to a pro-life conference and there were a lot of young students protesting and I remember us leaving, and they were saying, 'Shame on you'. My response was, 'It's my belief I am standing for good, for life'. Because only God can give or take life."

For many, the concern is that the next Pope will, almost inevitably, be a conservative. For the last three decades, after all, there has been a centralising and anti-liberal tendency, propelled by Pope John Paul II and his "reform of the reforms" of the Second Vatican Council in the 1960s. Woehrling believes the way the child abuse scandals were handled by the church was the result of that shift.

O'Brien's statements about gay marriage may have caused outrage in the secular world, but in Catholic terms he is something of a liberal figure. Many of his supporters talk of how he tried, long ago, to air the issue of whether priests should be married, but was clamped down upon from above. In this context, conspiracy theories are rife. One liberal Catholic believes the timing of the allegations against O'Brien, even if they are true, suggests "an attempt to stop a liberal Cardinal voting in the papal election".

Would the continuation of this conservative tendency within the church cause some to leave? It seems not. "If the new Pope continues a conservative, drawing-in line," says Cochrane, "I don't think liberal Catholics will split off into their own church. My temptation would be just to meet with other people who think like me, to pray, and to support each other in how we're going to live."

There is also a belief that a lot of the good done by the Catholic church, and by individual Catholics, is being obscured by scandal. Gracie sees the hierarchy as "a kind of crust, and the crust is what people see, but there's a whole bubbling pie underneath all that.

"There are so many good things being done by individual Catholics and organised Catholics, and that outweighs these issues. It may not seem like that from the outside, but it does so for me".

That said, the issue of sexual morality is not about to go away – and for some it remains a major thorn. Almost all of the scandals and controversies appear to stem from it.

"The overall message for me," says Cochrane, "is that the church needs to address sexuality generally, whether heterosexual or homosexual. I think the church needs to address that people are sexual human beings."