EXCLUSIVE: Spec scripts continue to be red-hot this January. CBS just snatched one from It’s Always Sunny in Philadelphia writer/co-executive producer/recurring guest star David Hornsby, which has been greenlighted to pilot. Hornsby wrote the project, How To Be a Gentleman, and is attached to star. Loosely based on John Bridges’ book How To Be a Gentleman: A Contemporary Guide to Common Courtesy, the show is described as a buddy comedy about an uptight guy learning to live his life with the help of his old high school classmate. Hornsby will play one of the two leads in the project, whose format (multi- vs. single-camera) is yet to be determined.

Hornsby first got interested in using Bridges’ book as a jumping-off point for a series several years ago. He wrote the project on spec at Media Rights Capital, which had optioned the rights to the book. It was pitched to CBS on Tuesday, and, 24 hours later, there was a deal. The pilot is being laid off at CBS TV Studios, which will produce it. Hornsby is executive producing with manager/producer Ted Schachter and MRC.

In addition to his duties as a writer/co-exec producer on Sunny, where he is now working on the upcoming seventh season, Hornsby recurs on the FX comedy as the defrocked priest Matthew Mara, aka Rickety Cricket. He has been with the series from the very beginning, appearing in the original utra low-budget pilot. Additionally, Hornsby voices the title character on the Nickelodeon animated series Fanboy and Chum Chum and did an arc on the HBO drama Six Feet Under and.How To Be a Gentleman was sold by WME, marking the agency’s seventh spec sale in the last 2 weeks.

RELATED: It’s January Spec Script Bonanza At The Broadcast Networks