The Oscar-winning actress first suffered the condition in the 1980s when she was acting in the West End in the musical Me And My Girl and endured a particularly bad spell in the 1990s when her marriage to Kenneth Branagh broke down.
Speaking on Radio 4's Desert Island Discs, Thompson admitted that writing the screenplay for Sense And Sensibility kept her alive during her personal crisis.
"The only thing I could do was write," said the 50-year-old, who is now married to Greg Wise. "I used to crawl from the bedroom to the computer and just sit and write, and then I was alright, because I was not present. Sense And Sensibility really saved me from going under, I think, in a very nasty way."
Describing acting as "an escape from myself", Thompson admitted that it is an escape that she loves. She attributed her success to the fact that her career is not based on her looks.
She said: "I don't think I am considered a beauty... I've always thought of myself as a character actress, so in a sense I've got much less to lose."