Actor Jerry O’Connell was on a set of a TV show and frequently complaining about his life, when a coworker gave him a copy of the book “The Secret.”

“I said, ‘Oh brother. This is going to be like a cult,’” O’Connell recalled. “I read it and it was very helpful. It was a really crazy time in my life professionally. I know it sounds cheesy to say this, but I visualized if they ever made a scripted version of the film, I wanted to be in it.”

He is.

“The Secret: Dare to Dream” hit premium video on demand outlets on July 31. The film was originally slated for an April 17 theatrical release by Roadside Attractions, but the COVID-19 pandemic changed that.

The movie tells the story of Miranda Wells (Katie Holmes), a hard-working young widow struggling to raise three children, when she encounters Bray Johnson (Josh Lucas). He’s carrying—literally—a secret that could change Miranda’s life. Meanwhile, she’s involved with her coworker, Tucker, played by O’Connell.

Written by Rhonda Byrne, “The Secret” was one of 2006’s best-selling self-help books, based on an earlier film of the same name. It is based on the belief of the law of attraction, which claims that thoughts can change a person’s life directly. It sold 30 million copies worldwide and has been translated into 50 languages.

“The book has such a fanbase,” O’Connell said. “It has changed so many people’s lives. I’m interested to see what ardent followers of the rules of attraction will think about the scripted version of their beloved book.

“It’s an international phenomenon, ‘The Secret.’ This is a dramatic version of that. I think the most challenging part is making sure the secret, this is the dramatic version of that. I think the most challenging part is making sure—I wouldn’t call it the fans—the followers of ‘The Secret’ are happy with what we did.”

The movie was directed by Andy Tennant, with whom Lucas fans would be familiar because he helmed “Sweet Home Alabama” as well.

“They certainly got the right person when they got Andy Tennant to come do it,” O’Connell said. “He’s our writer/director and I guess he really is one of the kings of rom-com. It was just so interesting that they went to him with the scripted version of ‘The Secret.’”

O’Connell is keeping busy these days. Amazon’s IMDB TV is carrying his show “Carter,” which is about an actor who played a cop on television and has a problem determining the difference between reality and fiction.

He also voices Cmdr. Jack Ransom on CBS All Access’ “Star Trek: Lower Decks,” which premieres on August 10. He describes the 10-episode run as a comedic version of “Star Trek.”

During the pandemic, O’Connell says he’s using his “laws of attraction” talents and visualization techniques to get his kids back in school. (He’s kidding.)

He’s hoping that fans and followers of “The Secret” have as much fun with the movie as he did.

“It was a fun set,” O’Connell saids. “Katie Holmes is such a doll She’s so much fun to work with.

“And man, I wasn’t playing his love interest, but that Josh Lucas is so dreamy. I had scenes with him—not to judge him—but I do get lost in his Paul Newman-esque blue eyes.”