• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Changing all Layer names to Uppercase

Community Beginner ,
Jan 17, 2012 Jan 17, 2012

Copy link to clipboard

Copied

I have been trying to clean up the layers in a document(s) with the following script.  It all works except for the UPPERCASE line.

Does anyone have any ideas?

function standardizeLayerNames()

            {

                var myDoc7=app.activeDocument

                var myLayerCount7 = myDoc7.layers.length

                for(var myCounter7 = 0; myCounter7 < myLayerCount7; myCounter7++){

                        var selectLayer7 = myDoc7.layers[myCounter7]

                       

                        selectLayer7.visible=true

                        selectLayer7.locked=false

                        selectLayer7.name = selectLayer7.name.replace ("-", "_")

                        selectLayer7.name = selectLayer7.name.replace(" ", "_")

                        selectLayer7.name = selectLayer7.name.CaseChangeType.UPPERCASE

                }

     }

TOPICS
Scripting

Views

1.0K

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
community guidelines

correct answers 1 Correct answer

Enthusiast , Jan 17, 2012 Jan 17, 2012


function standardizeLayerNames() {

          var myDoc7 = app.activeDocument;

          var myLayerCount7 = myDoc7.layers.length;

          for (var myCounter7 = 0; myCounter7 < myLayerCount7; myCounter7++) {

                    var selectLayer7 = myDoc7.layers[myCounter7];

                    selectLayer7.visible = true;

                    selectLayer7.locked = false;

                    selectLayer7.name = selectLayer7.name.replace(/[- ]/g, "_").toUpperCase();

          }

}

Votes

Translate

Translate
Adobe
Enthusiast ,
Jan 17, 2012 Jan 17, 2012

Copy link to clipboard

Copied


function standardizeLayerNames() {

          var myDoc7 = app.activeDocument;

          var myLayerCount7 = myDoc7.layers.length;

          for (var myCounter7 = 0; myCounter7 < myLayerCount7; myCounter7++) {

                    var selectLayer7 = myDoc7.layers[myCounter7];

                    selectLayer7.visible = true;

                    selectLayer7.locked = false;

                    selectLayer7.name = selectLayer7.name.replace(/[- ]/g, "_").toUpperCase();

          }

}

Votes

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
community guidelines
Community Beginner ,
Jan 18, 2012 Jan 18, 2012

Copy link to clipboard

Copied

moluapple

Thank you very much.  Would you happen to have a resourse that I could reference that describes the search string and how to set it up?

If not, this still saves me several hours and multiple headaches...

Votes

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
community guidelines
Community Expert ,
Jan 18, 2012 Jan 18, 2012

Copy link to clipboard

Copied

search for Javascript Regular Expressions or RegExp Object

Votes

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
community guidelines
Guru ,
Jan 18, 2012 Jan 18, 2012

Copy link to clipboard

Copied

LATEST

Votes

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
community guidelines