Automatically override and unlock master page elements across all pages using labels.
π Get the Script: UnlockByLabel.jsx on GitHub
UnlockByLabel.jsx is a JavaScript (ExtendScript) tool for Adobe InDesign that lets you automatically override and unlock master page elements based on their Script Label. It's ideal for layout workflows where shared graphic elements (like filigree frames or background images) need to be customized per page.
The script scans each page, looks at its applied master page, and then finds and unlocks specific master items with labels that match a provided list.
Open your master page, select the item (image frame, text box, etc.), then open
Window > Utilities > Script Label
and assign a label like FiligreeImage
.
Create a new `.jsx` file in your InDesign Scripts Panel folder. Paste in the full UnlockByLabel script, then run it from the Scripts panel inside InDesign.
// Label targets
var labelsToUnlock = ["FiligreeImage", "BackgroundImage"];
...
// Loop through pages and unlock matching master items
if (String(item.label) === labelToFind) {
var overriddenItem = item.override(page);
overriddenItem.locked = false;
}
Once your file is ready and the script is installed, double-click it from the InDesign Scripts panel. Youβll get a popup summary and full console log of all processed items.
Want to target different labels? Just modify this line:
var labelsToUnlock = ["FiligreeImage", "BackgroundImage", "YourCustomLabel"];
The script will only unlock items that arenβt already overridden, so it's safe to run multiple times during your workflow.
Download the full script, assign labels, and unlock items automatically across your entire document in seconds.
π Full Source Code: UnlockByLabel.jsx on GitHub