Ben Affleck, left, and Jason Bateman star in 'Extract,' the new comedy from Mike Judge.

It's set in a cooking-extract factory instead of amid a cubicle jungle, but "Extract" -- the newest comedy of errors from writer-director Mike Judge -- is really "Office Space" with just a slightly different flavor.

Both are workplace comedies written and directed by Judge, both are populated almost entirely by idiots (Judge's favorite subject) and both are amusing bits of diverting silliness.

"Extract" lacks much of the satirical edge of "Office Space," and of Judge's lesser 2006 comedy "Idiocracy," but with its immensely likable cast elevating the material, Judge extracts just enough ironic chuckles to rescue the movie from being written off as an assembly-line comedy.

Perhaps figuring that the collating masses that confered favored status upon "Office Space" have earned job promotions since that 1999 movie became such a cable-TV and home-video success, Judge turns the tables a bit this time. Instead of delivering a poke in the eye to the idiots in the corner offices, the hero this time is one of those managers (Jason Bateman), and it's the mouth-breathing timecard-punchers who are the morons.

Mila Kunis in a scene from 'Extract.'

EXTRACT2.5 stars, out of 4

Snapshot: A workplace comedy about the owner of a cooking-extract factory and the comedy of errors that his life becomes.

What works: It boasts an immensely likable cast, and manages to be fun enough to qualify as a pleasant diversion.

What doesn't: It lacks the satirical edge that made director Mike Judge's "Office Space" so relevant to so many.

Specifically, Bateman plays the owner of an extract factory -- an odd choice of settings -- who is on the verge of selling his company for a tidy profit.The reliable J.K. Simmons is there to help, in a factory-worker role reminiscent of his part back in January in the Harry Connick Jr. romantic comedy "New in Town," and Mila Kunis ("Forgetting Sarah Marshall") is there to complicate things, as the criminally pretty factory worker who gets everything she wants.

Just before the buyout can be finalized, however, a mishap on the factory floor costs an employee a testicle. So the ball is in Bateman's court: He can either settle with bus-bench lawyer Gene Simmons, or he can scuttle the buyout by going to court.

Things aren't much better for him at home, as his on-the-job demands have strained his mostly sexless relationship with his wife (Kristin Wiig of "Saturday Night Live").

Enter a shaggier-than-usual Ben Affleck, as a friend of Bateman's who dispenses some of the worst advice imaginable (along with pills and booze) from his perch behind a local hotel bar. Naturally, Bateman takes it -- the advice, the pills and the booze -- and the wheels come off entirely, with help from a gigolo, a klepto and a bong the size of a didgeridoo.

But even if his script falters occasionally -- including a jarring case of marital infidelity that is played for laughs -- Judge proves in "Extract" that he does at least two things as well as anyone. He knows how to create realistic, sympathetic, Everyman heroes -- and he knows how to mire them in the most absurd of circumstances.

"Extract" certainly won't resonate with as many people as Judge's "Office Space" did -- there are far fewer owners of extract factories than there are cubicle prisoners -- but "Extract" is still flavorful enough to keep audiences from leaving the theater with a bad taste in their mouth.