Script writers for both television sitcoms and dramas were given the license Thursday to be as raunchy as they like during the creative process — as long as their raw talk doesn’t single out specific people as the butt of the jokes.

In a case that put the entertainment and publishing industries on edge — and had some Hollywood honchos speaking out — the California Supreme Court unanimously ruled that sexually coarse and vulgar language is often a necessary part of the creative process when producing a hit TV show.