Highlighted

Javascript to Unlock All Layers

New Here ,
May 21, 2020

Copy link to clipboard

Copied

I can't seem to find a simple javascript to "Unlock All Layers" for illustrator.

I just want to litterally unlock all layers 🙂

 

Any help out there? 

Adobe Community Professional
Correct answer by Charu Rajput | Adobe Community Professional

Hi,

Please try following snippet to unlock all layers and sublayers in Illustartor

 

function unlockLayers(_layers) {
    for (var i = 0; i < _layers.length; i++) {
        if (_layers[i].locked) {
            _layers[i].locked = false;
        }
        if (_layers[i].layers.length)
            unlockLayers(_layers[i].layers);
    }
}
unlockLayers(app.activeDocument.layers);

 

Let us know if this helps

 

TOPICS
Scripting

Views

565

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Javascript to Unlock All Layers

New Here ,
May 21, 2020

Copy link to clipboard

Copied

I can't seem to find a simple javascript to "Unlock All Layers" for illustrator.

I just want to litterally unlock all layers 🙂

 

Any help out there? 

Adobe Community Professional
Correct answer by Charu Rajput | Adobe Community Professional

Hi,

Please try following snippet to unlock all layers and sublayers in Illustartor

 

function unlockLayers(_layers) {
    for (var i = 0; i < _layers.length; i++) {
        if (_layers[i].locked) {
            _layers[i].locked = false;
        }
        if (_layers[i].layers.length)
            unlockLayers(_layers[i].layers);
    }
}
unlockLayers(app.activeDocument.layers);

 

Let us know if this helps

 

TOPICS
Scripting

Views

566

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 21, 2020 0
Adobe Community Professional ,
May 21, 2020

Copy link to clipboard

Copied

Hi,

Please try following snippet to unlock all layers and sublayers in Illustartor

 

function unlockLayers(_layers) {
    for (var i = 0; i < _layers.length; i++) {
        if (_layers[i].locked) {
            _layers[i].locked = false;
        }
        if (_layers[i].layers.length)
            unlockLayers(_layers[i].layers);
    }
}
unlockLayers(app.activeDocument.layers);

 

Let us know if this helps

 

Best regards

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 21, 2020 4
New Here ,
May 22, 2020

Copy link to clipboard

Copied

Perfect!

Thank you! 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 22, 2020 0
Adobe Community Professional ,
May 22, 2020

Copy link to clipboard

Copied

You're welcome 🙂

Best regards

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 22, 2020 0