Ruth Sacks Caplin and her husband, former IRS commissioner Mortimer Caplin, celebrate the opening of the film "Mrs. Palfrey at the Claremont,” based on Mrs. Caplin’s screenplay. (Bill O'Leary/The Washington Post)

Ruth Sacks Caplin was 85 on her first opening night.

She had been a writer all her life, just not a published one, and began the project more than three decades ago with little fanfare. She bought a how-to guide to writing movie screenplays, and then she wrote one.

The result — “Mrs. Palfrey at the Claremont,” directed by Dan Ireland and starring actress Joan Plowright, the widow of Laurence Olivier — was released in 2005. Based on a book by British novelist Elizabeth Taylor, the film recounted the spirit-sustaining friendship between an elderly widow and a young writer and was “a delight,” wrote film critic Roger Ebert, “in ways both expected and rare.”

Mrs. Caplin died Aug. 5 at a hospital in Bethesda, Md. She was 93 and had a heart ailment, said her son Michael Caplin.

Mrs. Caplin was traveling in London in the late 1970s with her husband, Mortimer Caplin, a prominent Washington lawyer who served as IRS commissioner under President John F. Kennedy, when she happened upon the novel that would inspire her screenplay.

The book, also titled “Mrs. Palfrey at the Claremont,” centers on Laura Palfrey, who checks herself into a residential hotel for the elderly in London and finds relief from her loneliness in companionship with Ludo, an aspiring writer who becomes a surrogate grandson.

When she read it, Mrs. Caplin told The Washington Post, the book went to her heart. The Caplins’ 29-year-old daughter, Mary Ellen, had recently died from cancer, and Mrs. Caplin took a degree of comfort in the story of a woman finding her way forward in grief. Working on the screenplay, she said, allowed her to retreat to an “imaginary, quiet” place.

Mrs. Caplin, who referred to e-mails as “telegrams,” composed her work on a manual typewriter. She had never liked unhappy endings, her son said, and brightened some of the book’s darker moments in her screen adaptation.

For decades the script languished. Then, in 1999, her son Lee Caplin — a movie producer whose credits would include the 2001 film “Ali” staring Will Smith — obtained the rights to make a film with his mother’s screenplay.

Lee and Mortimer Caplin arranged to fly her to London, where, to her surprise, Mrs. Caplin found the film in production. Actor Rupert Friend played Ludo. Plowright, who had previously appeared in films including “Enchanted April” and “Tea With Mussolini,” had been cast in “possibly her best role in the flickers,” movie critic Stephen Hunter wrote in The Post upon the film’s release.

“It is a nice surprise, in the senior quarter of my life,” said Mrs. Caplin, “to have this bloom.”

Ruth Sacks, the daughter of Jewish immigrants from Eastern Europe, was born Sept. 5, 1920, in New York City. Both her parents were lawyers.

She received a bachelor’s degree in art education from Skidmore College in Saratoga Springs, N.Y., in 1941 and married her husband, whom she had met in her teens, the following year.

In the early years of their marriage, Mrs. Caplin worked as a fashion designer in New York. After moving to Charlottesville, where her husband was a professor at the University of Virginia’s law school, she wrote, directed, designed and sewed costumes for children’s plays in the local public schools.

During Virginia’s “massive resistance” to desegregation in the late 1950s, when officials closed many public schools to avoid admitting black students, Mrs. Caplin and other mothers organized an effort to keep makeshift classes in session.

“I went to second grade in my own basement,” said Michael Caplin, recalling that his mother set up a blackboard in the house and taught music, dance and studio arts.

In Washington, where the family moved when Mortimer Caplin became IRS commissioner in 1961, Mrs. Caplin continued her work in children’s dramatic arts. She received a master’s degree in counseling and therapy from American University in 1977 and did therapy from her home in Chevy Chase until retiring in her late 80s.

Among other philanthropic initiatives, the Caplins donated $4 million for the creation of the 300-seat Ruth Caplin Theatre, which opened at the University of Virginia last year.

Survivors include her husband of 71 years, Mortimer Caplin of Chevy Chase; four children, Lee Caplin of Carmel, Calif., Michael Caplin of McLean, Va., Jeremy Caplin of Charlottesville and Cate Caplin of Los Angeles; eight grandchildren; and two great-grandchildren.

Although “Mrs. Palfrey” was Mrs. Caplin’s first professional artistic venture, it was not her first adaptation of a literary work. When she read to her children, her son Michael recalled, she frequently changed elements of the stories.

In the Caplin family’s copy of “Hansel and Gretel,” the more frightening developments were redacted with black ink. By Mrs. Caplin’s telling, Babar, the young elephant of the classic children’s series, is orphaned not because a hunter kills his mother, but because she runs away to escape his bullet. In E.B. White’s “Charlotte’s Web,” Wilbur does not lose the company of his wise spider-friend.

Mrs. Caplin simply went “off script,” her son said, so that her children would not endure such sadness.