Answered
How to determine the length of the current layer
This jsfl can add a blank keyframe to the last frame of the current layer
But there will be an error that automatically extends to the end frame of the timeline
how to fix
if (aslayer.frameCount < tl.frameCount) {
tl.insertBlankKeyframe(tl.frameCount);
} else {
if (aslayer.frames[aslayer.frameCount].startFrame !== aslayer.frameCount) {
tl.insertBlankKeyframe(tl.frameCount);
}
}