His one-man Off Broadway show, “Everything’s Fine,” directed by John Lithgow, had opened just weeks ago.Douglas McGrath, a playwright, screenwriter, director and actor who was nominated for an Oscar, an Emmy and a Tony Award, and whose one-man Off Broadway show, “Everything’s Fine,” opened just weeks ago, died on Thursday at his office in Manhattan. He was 64.His death was announced by the show’s producers, Daryl Roth, Tom Werner and John Lithgow. Their representative said the cause was a heart attack.Mr. Lithgow also directed the show, a childhood recollection of Mr. McGrath’s about a middle-school teacher in Texas who gave him an inappropriate amount of attention.“He was a dream to direct,” Mr. Lithgow said on Friday. “None of us had ever worked with someone who was so happy, proud and grateful to be performing his own writing.”Mr. McGrath in his one-man play “Everything’s Fine,” which opened Off Broadway last month to good reviews.Jeremy DanielMr. McGrath had a wide-ranging if under-the-radar career in television, film and theater. In the 1980-81 season, just out of Princeton and still in his early 20s, he was a writer for “Saturday Night Live.” Over the next decade he wrote humor pieces for The New Republic, The New York Times and other publications.By the 1990s he was making inroads in Hollywood. He wrote the screenplay for the 1993 remake of the 1950 romantic comedy “Born Yesterday,” and the next year he and Woody Allen collaborated on the script for Mr. Allen’s “Bullets Over Broadway.” The two shared an Oscar nomination for best original screenplay.In 1996 he adapted the Jane Austen novel “Emma” for the big screen and also directed the film, which starred Gwyneth Paltrow. In 2000 he and Peter Askin shared directing and screenwriting duties on the comedy “Company Man,” in which he also starred, as a schoolteacher who stumbles into a career as a C.I.A. officer.That movie drew some unflattering reviews. But his next, “Nicholas Nickleby” (2002), an adaptation of the Dickens story that he both wrote and directed, was well received. In The Times, A.O. Scott said that Mr. McGrath’s adaptation was rendered “with a scholar’s ear and a showman’s flair.”“The director has produced a colorful, affecting collage of Dickensian moods and motifs,” Mr. Scott wrote, “a movie that elicits an overwhelming desire to plunge into 900 pages of 19th-century prose.”Mr. McGrath, center, on the set of his film “Nicholas Nickleby” (2002), with the cast members Barry Humphries, left, and Alan Cumming.United Artists, via AlamyIn addition to his screenwriting and directing credits (which also included “Infamous,” a 2006 film starring Toby Jones as Truman Capote), Mr. McGrath occasionally took small acting roles in other people’s projects, including several of Mr. Allen’s films. In 2016 he directed “Becoming Mike Nichols,” an HBO documentary about the film director, on which he was also an executive producer. He shared an Emmy nomination with the other producers for outstanding documentary or nonfiction special.Throughout, he continued to work in the theater. In 1996 he wrote and starred in “Political Animal,” a one-man comedy that played at the McGinn/Cazale Theater in Manhattan, in which he played a right-wing presidential candidate.“Beyond the stand-up parody,” Ben Brantley wrote in his review in The Times, “the larger point of ‘Political Animal’ is that it takes a hollow, desperate man to run for president these days.”In 2012 his play “Checkers” — the title refers to a famous 1952 speech by Richard M. Nixon — was seen at the Vineyard Theater in Manhattan, with Anthony LaPaglia as Nixon and Kathryn Erbe as his wife, Pat.Then came Broadway: Mr. McGrath wrote the book for “Beautiful: The Carole King Musical,” which opened in January 2014 and ran for more than five years. His book was nominated for a Tony Award.Last month Mr. Lithgow told The Daily News of New York that Mr. McGrath had sent him “Everything’s Fine” unsolicited, and that he had no intention of directing a play until he read the piece.“It was so play-able,” he said, “I could simply imagine an audience being completely captivated by it.”The show opened in mid-October to good reviews.“It is impossible to overstate Doug’s pure likability,” Mr. Lithgow said on Friday. “In his solo show, he told a long story about his 14th year, and it worked so well because he had retained so much of his sense of boyish discovery.”Ms. Roth, another of the show’s producers, said that Mr. McGrath had been thoroughly enjoying the way audiences were reacting as he unspooled the tale.“The wonderful response from the audience was cathartic, meaningful and joyful to him,” she said by email. “He often told me he was in his ‘happy place’ onstage telling his story.”Mr. McGrath on the set of “Infamous,” his 2006 film about Truman Capote.Van Redin/Warner Independent, via Kobal, via ShutterstockDouglas Geoffrey McGrath was born on Feb. 2, 1958, in Midland, Texas. His father, Raynsford, was an independent oil producer, and his mother, Beatrice (Burchenal) McGrath, worked at Harper’s Bazaar before her marriage.“People often ask me what growing up in West Texas was like,” Mr. McGrath said in “Everything’s Fine.” “I think this sums it up: It’s very hot, it’s very dusty, and it’s very, very windy. It’s like growing up inside a blow dryer full of dirt.”He graduated from Princeton in 1980.“Planning my future,” he wrote in a 2001 essay in The Times, “I had a very clear idea of what I wanted to do, but a very blurry one of how to do it. I knew I wanted to write and perform in my own films in the manner of my idol, Woody Allen. But when I went, that once, to the Career Counseling Center and faced the bulletin board, none of the cards said, ‘Needed: writer-actor-director for major feature, no experience required, must be willing to earn high salary.’”Yet when a friend told him “S.N.L.” was hiring writers, he sent in some sketches and landed an $850-a-week job.“It seemed too good to be true,” he wrote. “It was. My year, 1980, was viewed then and still as the worst year in the show’s history, which is no small achievement when you think of some of the other years.”In a 2016 interview, Mr. McGrath said his disappointment with the way his screenplay for “Born Yesterday” was handled changed the direction of his career.“I remember thinking, well, if I don’t want to spend the rest of my life doing this, meaning watching someone else muck up what I did, there’s only one way around that,” he said. “I have to become a director.”Mr. McGrath, who lived in Manhattan, married Jane Read Martin in 1995. She survives him, as do a son, Henry; a sister, Mary McGrath Abrams; and a brother, Alexander. More