IN a startling midcareer switch, JENNIFER ANISTON is returning to TV thanks to her “Friends” co-star and BFF COURTNEY COX.

The 43-year-old beauty is tired of her hit-and-miss movie track record, and she’s taking Courteney’s advice to land a top-notch TV project – prob­ably for HBO or Showtime – where she can reinvent herself as she makes the transition to mature leading lady, say insiders.

“Jennifer’s looking for an edgy, character-driven show along the lines of Edie Falco’s ‘Nurse Jackie,’ Mary- Louise Parker in ‘Weeds’ or Glenn Close in ‘Damages,’” a source close to the actress told The ENQUIRER.

“She’s tired of so-so film scripts, bad movie reviews and disappointing box-office sales. She also thinks she’s getting too old to star in big-screen romantic come­dies.

“So after a heart-to-heart with Courteney, she made up her mind to reinvent herself as a serious actress back on TV where she got her start.”

Jennifer is desperate for a juicy role she can sink her teeth into the way her good friend Laura Dern’s done in the HBO series “Enlightened,” the source added. And her production team is said to be working overtime looking for proj­ects with memorable female characters.

“She joked she’ll even play a one-legged, crack-addicted prostitute as long as it’s a believable role,” revealed the source.

While Aniston still has a few film commitments, she’s looking forward to her leap back onto the small screen.

Jen’s won both an Emmy and Golden Globe Award for “Friends,” but the beauty has never been nominated for a major award for any of her film roles. She was, however, nominated for a Golden Raspberry Award, or “Razzie” for Worst Actress in 2011 for her films “The Switch” and “The Bounty Hunter,” and in 2012 as Worst Screen Couple with Adam Sandler for “Just Go with It.”

“Jen hasn’t had a great movie re­view since ‘The Good Girl’ way back in 2002,” noted the source. “She’s hoping a dramatic TV role can win her the praise she’s been lacking from her recent films.”