Split Layer Name

Extract parts of a layer name to display as text — useful for data-driven templates.

Expression Code

// Split Layer Name
// Apply to Source Text
// Works with names like "John | Designer | NYC"

name = thisLayer.name;
parts = name.split(" | ");
parts[0];  // Returns "John"

// parts[1] for "Designer"
// parts[2] for "NYC"
Name your layer with pipe-separated values (e.g., "John | Designer | NYC"). Apply this expression to a text layer's Source Text, then use parts[0], parts[1], etc. to display each segment. 1. Rename the layer with your data: "Name | Title | Location" 2. Create text layers for each piece of data 3. Apply this expression, changing the parts index for each