Color Layers
Script
Free
Layer Color Medium Slateblue
By Jack Vaughan
Updated 11/1/2025
About
Sets the timeline layer color of selected layers and all their children to medium slate blue. Useful for quickly organizing and visually grouping related layers in your timeline.
Code
// Layer color Medium Slateblue.js// Sets the timeline layer colour of selected layers (and all descendants) to Medium Slateblue.var setColorId = function(nodeId, colorIndex) {try { api.set(nodeId, { colorId: colorIndex }); return true; } catch (e) {}try { api.set(nodeId, { "attributes.colorId": colorIndex }); return true; } catch (_) {}return false;};var getChildrenSafe = function(nodeId) {try { var kids = api.getChildren(nodeId) || []; return kids.slice(); } catch (_) { return []; }};var applyRecursively = function(nodeId, colorIndex) {setColorId(nodeId, colorIndex);var children = getChildrenSafe(nodeId);for (var i = 0; i < children.length; i++) applyRecursively(children[i], colorIndex);};var selection = api.getSelection();if (!selection || !selection.length) {console.warn("Select layer(s) to set layer colour to Medium Slateblue.");} else {var COLOR_INDEX = 10;for (var i = 0; i < selection.length; i++) applyRecursively(selection[i], COLOR_INDEX);console.log("\u2713 Set layer colour to Medium Slateblue for " + selection.length + " root layer(s) and their children.");}