Auto Grid
Automatically arrange duplicated layers into a grid based on their layer index.
Expression Code
// Auto Grid// Apply to Position// Duplicate the layer to fill the gridcols = 4; // Number of columnsspacingX = 200; // Horizontal spacingspacingY = 200; // Vertical spacingstartX = 200; // Grid start XstartY = 200; // Grid start Yi = index - 1;col = i % cols;row = Math.floor(i / cols);x = startX + col * spacingX;y = startY + row * spacingY;[x, y];
Apply to Position on a layer. Set your grid columns and spacing. Duplicate the layer — each copy automatically positions itself in the grid based on its layer index.