Script supervisor Robert Gary, who worked on all the “Star Trek” series, died Monday of natural causes in Los Angeles. He was 90.

Gary was script supervisor on the original “Star Trek” as well as “The Next Generation,” “Voyager” and “Deep Space 9.”

Gary started out as an actor but during the days of the Hollywood blacklist in the 1940s and ’50s decided to take a less high-profile job.

He’d considered himself a left-winger, according to an NPR account, and after watching a friend being pushed out for his alleged Communist beliefs, Gary joined the shoot of 1956’s “The Searchers” as a script supervisor.

Although he was teased for taking a job that was mostly done by women, Gary was ready and willing, plus helmer John Ford didn’t want a woman on the arduous shoot in Monument Valley.

Gary went on to work with high-profile directors including William Wyler and George Stevens. His film credits include “The Diary of Anne Frank,” “Hush, Hush Sweet Charlotte” and “Whatever Happened to Baby Jane.” On TV he worked on “ER,” “Matlock,” “Dynasty” and “Perry Mason,” among other skeins.

“The director’s point of view is how the scene plays, what the audience should be thinking,” he was quoted as saying in a 2003 interview in Below the Line magazine. “The script supervisor has the task of seeing that the dialogue is right and all the technical elements match. We never tell anyone what to do, but we are quietly involved in everybody else’s job: crew, wardrobe, actors, makeup, props. We’re an extra pair of eyes.”

He served as a board member of IATSE Local 871.

In the late 1980s Gary started teaching a course on script supervision at UCLA’s School of Theater, Film and TV, said his manager Frances Coyle. He stopped working a couple of years ago after he had a stroke, which impaired his mind.

Survivors include a sister.