(→top: ---Numerous fixes in lede and infobox.)
(→Plot: ---Copy-edit for length and clarity.)
▲Jack Gable (Candy) is the New York City-based lead writer and producer of the [[soap opera]] "Beyond Our Dreams". Consumed by his work, he harbors an unspoken attraction to Laura Claybourne (Samms), the selfish actress playing the lead character of Rachel Hedison.
▲Made late to the office by a long wait for a visit by an unpleasant cable repairman, Jack crosses paths with Louise (Hemingway), an actress who is there to interview for the part of Janet DuBois, a character Jack had made plain he did not want introduced. Jack then has a contentious meeting with his co-producers, the Sherwoods. The Sherwoods reveal that they are displeased with several elements of Jack's outline for the upcoming season and wish to kill off Rachel Hedison, due to Laura's outrageous contract demands. Feigning compromise, the Sherwoods immediately hire Arnie Federman, a rival of Jack's, to make the changes they desire. At the same time, Jack has suggested a new character into the show, Jack Gates, a ruthless millionaire tycoon ("The Wolf of Wall Street") who reflects a character Jack dreams for himself. The Sherwoods make no promise of writing Jack Gates into the show, despite Jack's interest in the character.
▲Planning an escape to Vermont for the weekend, Jack is contacted by Laura. She has just broken up with her boyfriend Dennis, the actor who plays Rachel's boyfriend Dr. Paul Kirkwood on the show, and wishes to accompany Jack. As Jack loads their luggage into his car, Dennis suddenly appears and calls out to Rachel. Jack looks up from his trunk to see them kissing passionately. The trunk snaps up and smashes into Jack's chin. Upon awakening, he drives toward Vermont himself, alone and distraught. Not far out of New York, he crashes his car.
Jack seizes his new found power to pursue Rachel
▲Upon waking from the crash, Jack finds himself in Ashford Falls Community Hospital, one of the prime settings of his show. Thinking himself the victim of a prank by the actors, he goes to the window to confirm his suspicions, only to find the view beyond the glass (a complete town) is entirely of his own creation. Incredulous, he manages to convince Dr. Kirkwood of his good health and checks out of the hospital. He is immediately intercepted by Janet DuBois, in the form of the actress he encountered earlier. She believes him to be Jack Gates, who is seeking to buy a miracle weight-loss formula developed by her late father. However, Jack is only interested in returning to his world and rebuffs her, denying he is Gates and saying that he is only a writer. As she leaves in frustration, she angrily tells him to "write his way out". On a whim, Jack gets out his typewriter and writes out a scene of the local mechanic calling to say that his damaged car is fixed. Immediately after he does so, the mechanic calls and confirms the repairs are finished. Jack realizes that he can control events by putting them out on his typewriter.
As Jack works
▲Jack seizes his new found power to pursue Rachel Hedison, saving her from the death arranged for her by Arnie Federman in the real world. Despite his inventive writing skills, she manages to ignore him, yet his futile efforts are redeemed by the attentions of Janet DuBois. He assists her in her efforts to avoid the machinations of the Hedisons, including patriarch Carter (Burr) and his sons, the capable Blake and inept Ty. The Hedisons, in charge of a large pharmaceutical empire, wish to acquire her formula at any cost. The Federman version of Jack Gates (played by Robert Wagner, uncredited in the film) also appears. Jack dispatches him by writing him off to a business trip in Cleveland.
Jack wakes up back in New York, on the set of his own show, tended to by Laura and Dennis. He immediately confronts Laura about her
▲As Jack works harder to ingratiate himself to Rachel, he continues to run into Janet. The episodes culminate in a party at the Hedison mansion, where Jack accidentally breaks his typewriter in a fit of pique. Helen Caldwell (Andrea Thompson), a nurse from the hospital (who was having an affair with Dr. Kirkwood until he recently dumped her for Rachel) reveals that Rachel and Janet were switched at birth, with Janet being the actual daughter of Carter Hedison, a twist arranged by Federman. Rachel plans to leave with Jack, just as he realizes how shallow and superficial she is. She is confronted by a gun-wielding Blake, who has been undergoing horrific side effects due to a gradual overdose of medication prescribed by Kirkwood, a scheme orchestrated by Rachel in an effort to take over his major role in the company. Blake mistakenly shoots Janet and she is rushed to the hospital, where Rachel has convinced Kirkwood to kill her in surgery. Jack must race against time to repair his typewriter and write Janet back to health. As Jack begins to write, he is confronted by Robert Wagner's Jack Gates, who is furious at having been sent to Cleveland and shoots Jack (Candy) with a shotgun.
▲Jack wakes up back in New York, on the set of his own show, tended to by Laura and Dennis. He immediately confronts Laura about her foul and domineering behavior, revealing to her that she will be fired from the show. He then tries to track down Louise, who had interviewed for the part of Janet. Jack then confronts the Sherwoods about their plans for the Janet character, as well as their use of Federman, and ensures that they will do things his way after he performs the Heimlich maneuver on Arlene Sherwood who is choking on a sandwich during the argument. He finally finds Louise in a delicatessen, gets her the part of Janet and begins a relationship with her. He also uses the typewriter one last time to send Laura to Cleveland where "she's turning letters on a game show."