Dan, thanks for the fast response!
That’s effectively what I’ve been trying (since my original post):
var comp=app.project.activeItem;
var myNull=comp.layers.addNull();
myNull.name=”My Null Name”;
but it still shows up as, say, “Null 1” in the timeline. Wait…
Okay, I’m an idiot. Instead of showing Layer name in the comp, it was showing Source name. Is there any way to programmatically switch between displaying Source names and Layer names? Or will I just have to remember to switch it manually?