Script for renaming selected shape layer items

Does anyone know if such a script exists?
That is to say, a script that renames the selected sub-items of a shape layer (paths, groups, shape generators etc).
Am aware there's already scripts to rename selected layers and layer masks. Have attempted to rewrite these to deal with shape layer items, but to no avail.
Many thanks

I was able to rename them using these:
"Path 1"
app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Shape - Group").name = "MY NEW PATH NAME";
"Shape 1"
app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Graphic - Stroke").name = "MY SHAPE NAME";
"Fill 1"
app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Graphic - Fill").name = "MY FILL NAME";
"Group 1"
app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Group").name = "MY GROUP 1 NAME";

Similar Messages

  • Script for batch delet redundant layer

    I have thousands files in the different folders, each file has same layer named “Job Info”. Can someone help me to write a script for del this layer folder by folder?
    I expected the script tells me that I have to select a folder, then it can automatically open the files, del “job info” layer then save file, rewrite, close file

    Hi Ashram,
    Sorry, I misunderstood your question. Please try the below.
    var folder = Folder.selectDialog ("Select the root folder");
    var myfiles = [];
    var _layers = ["test1", "test2", "test3"];
    getsubfolderfiles(folder);
    for(var i =0;i<myfiles.length;i++)
            var doc = app.open(myfiles[i],false);
            for(var j=0;j<_layers.length;j++)
                try
                    app.activeDocument.layers.add({name:_layers[j]})
                catch(e){}
            doc.save();
            doc.close();
    function getsubfolderfiles(folder)
        var filelist = folder.getFiles();
        for(var i =0;i<filelist.length;i++)
            if(filelist[i] instanceof Folder)
                getsubfolderfiles (filelist[i]);
            else if(filelist[i] instanceof File)
                if(filelist[i].name.indexOf(".indd") > -1){
                    myfiles.push(filelist[i]);
    Hi HarveyLiu,
    Try this,
    var folder = Folder.selectDialog ("Select the root folder");
    var myfiles = [];
    getsubfolderfiles(folder);
    for(var i =0;i<myfiles.length;i++)
            var doc = app.open(myfiles[i],false);
            try{
                var _layer = doc.layers.item("Job Info");
                _layer.remove();
                var link, image, frame,
                links = doc.links, counter = 0;
                for (var i = links.length-1; i >= 0; i--) {
                    if (links[i].status == LinkStatus.LINK_MISSING) {
                        try {
                            link = links[i];
                            image = link.parent;
                            frame = image.parent;
                            frame.remove();
                            counter++;
                        catch (err) {
                            $.writeln(i + " - " + err);
            catch(e){}
            doc.save();
            doc.close();
    function getsubfolderfiles(folder)
        var filelist = folder.getFiles();
        for(var i =0;i<filelist.length;i++)
            if(filelist[i] instanceof Folder)
                getsubfolderfiles (filelist[i]);
            else if(filelist[i] instanceof File)
                if(filelist[i].name.indexOf(".indd") > -1){
                    myfiles.push(filelist[i]);
    Regards,
    Chinna

  • Is there a script for renaming layers in ID CS5?

    Hello,
    I am new to scripting (I just started today) so far I have found some very useful existing scripts to help automate my workflow. I am wondering if anyone knows of the existence of a layer renaming script for InDesign.
    I have seen similar scripts for PS. I want to learn how to script but I am in need of this one for Monday...
    Thanks in advance!

    Antonio:
      Please remember that we're all volunteers here. If you can ask your question so we can understand it, we can probably help you. But if you cannot, it would take quite a lot of effort on our part to even determine what you asking.
    Jongware wrote in the other thread:
    This is quite a specialized case so it's unlikely there "is" a script. But there "could be" one. Ask in the scripting forum, as there are some people in there sharpening their skills with such requests. Make sure to detail what you need it to do: which layers? rename to what? Et cetera.
    You're not doing a good job on detail. How would the script know what to change your first, 3rd, 4th, and 5th "atoms" to?
    You have given us no information that I can see.

  • HELP! Need a script for renaming layers

    Hi-
    I've got an Illustrator CS6 document that has 500+ layers with individual words on them (a word cloud).  I'm needing to animate this in AE.  When I "Release to Layers (Sequence)", all of the layers become Layer 1, Layer 2, etc.  Is there a script that will rename all of those layers to be the text inside them? 
    i.e. Layer 1 has the word "Pencil" as a sub-layer, editable text.. I need to rename the Top-Layer Layer 1 to "Pencil".  I'm hoping there is a script that can do this so I don't have to manually rename all of the layers.
    I have found this script:
    var idoc = app.activeDocument;
    var ilayer = idoc.activeLayer;
    for (i=0; i<ilayer.layers.length; i++) {
        var isublayer = ilayer.layers[i];
        isublayer.name = isublayer.pageItems[0].name;
    But is doesn't seem to do what I need.
    Any help would be greatly appreciated!
    Thanks,
    -Mark

    Hi Carlos-
    Here is part of my layers pannel before Releasing to Layers:
    Here is part of my layers pannel after Releasing to Layers:
    So I want Layer 6 to be "Hideaway Backpack Straps" without having to rename it manually.
    Any help would be great!
    Thanks
    Mark

  • Script for rename the pictures name as login names

    I have staff pictures (100+) and pictures name as ID of staff. But I want to rename all with login names. any idea of writing a script?
    Best
    lasantha

    Hi Lasantha,
    Please refer to the following post related to renaming user profile thumbnail.
    https://blogs.blackmarble.co.uk/blogs/rhepworth/post/2010/07/29/powershell-script-to-rename-files-for-use-as-sharepoint-2010-user-profile-thumbnails.aspx
    Please don't forget to mark it answered, if your problem resolved or helpful.

  • Script for renaming postscript files

    I need a script that will rename a postscript file at the time of printing. Ideally, after you hit the print button, a field would appear for you to enter the new name of the postscript file prior to sending it on to the printer. After you entered text, you hit enter again and the file goes to the printer for printing. The print log would show the new name. If anyone knows how to do this, I would appreciate your assistance. I could probably get you some cash.
    Thanks,
    Rich

    This forum is for scripting questions rather than script requests.
    Please start by reading the following:
    Posting guidelines
    Handy tips for posting to this forum
    How to ask questions in a technical forum
    Rubber duck problem solving
    How to write a bad forum post
    Help Vampires: A Spotter's Guide
    -- Bill Stewart [Bill_Stewart]

  • Action script for batch-opening psd layer files flat? (alt+shift?)

    hi
    i am daily batch processing with an action script to make flat tiffs from psd layer files, like 10-100 files every couple of days in my workflow.
    until now i could not fine a solution to begin the batch processing-action with opening layer files FLAT.
    the reason is: i am working with huge files, 5-20GB .psb files, (16bit, ECI-RGB, 50x100cm, 300dpi) and it takes a couple of seconds to open with my pcie-SSD.
    that multiplies the time it takes to open 50 of such files. i would gain a lot of time, if photoshop cs6 would not open it with layers, but flat.
    there is a workaround i am using daily: (osx) hold alt+shift, then click on the layer file in the finder and cs6 opens it flat.
    but that did not work in the action script. it doesnt store the keyboard command alt+shift.
    any idea how i could save time and use the alt+shift command in the action script or any other solution please?
    thanks
    peter

    I just tried to record this using ScriptListener, and it didn't record it either.  No indo in the ExtendScript SDK on this either.  I don't think that this is possible at this time.  Maybe someone who know more than I do can find a way.

  • Script for auto select of subtitle stream with 16:9 or 4:3 display

    I have an anamorphic 16:9 project that is set for 16:9 letterbox display. It is letterboxed in anamorphic for a 2.35:1 aspect ratio. I have 2 subtitle streams both identical in content. One stream is positioned for 16:9 displays with subtitles in the lower movie frame. The other stream is positioned for 4:3 displays with subtitles completely in the lower letterbox.
    I would like to create a script that can choose the appropriate stream depending on the user's setup (either 16:9 or 4:3). I would like the non-appropriate subtitle stream to appear non existent to the user. Basically, I don't want the user to have access to both of the streams. If they push the subtitle button on their remote, I would like to have just the proper one available. Can this be done in DVDSP? I'm not a total idiot with authoring, just not that experienced with scripting, so it's a little intimidating.
    I've gone as far to look in the manual and have found that SPRM 14 seems to be the key to display prefs. Could someone map out how to create such a script? Thank you.

    In general this script should work:
    mov GPRM0, SPRM14
    and GPRM0, 3072
    Set System Stream St(Subtitle Stream 1) (On) if GPRM 0 = 3072)
    Set System Stream St(Subtitle Stream 2) (On) if GPRM 0 != 3072)
    Jump Track 1
    The value of 3072 is returned when 16:9 value is stored in SPRM14.
    However some players may disregard this script as they might look for the presentation information in IFO files or in the video stream itself.
    The better approach is to flag one subtitle stream as 16:9 and the other as 4:3 in DVD After Edit if you have an access to it.
    MacPro 2.66, G5 DP 2.7   Mac OS X (10.4.9)   TASCAM DA-88, DigiBeta, DeckLink HD Extreme, Cinemacraft Encoder

  • Batch rename selected layers

    I'm trying to find a script that can help batch rename/renumber a group of selected layers.
    So far I've been able to find a script that renames every single layer in a Photoshop document (overkill). Or there's the CS6 Tab rename trick (too slow).
    I routintely export PSDs from Illustrator for use in After Effects. But in Photoshop, I'll get a couple hundred layers named <path> or <path> + <path> or <group>. Renaming by hand is out of the question. But I don't want to rename every layer the same.
    Any suggestions?

    I wrote one for you here...
    http://www.retouchpro.com/forums/photoshop-scripting/23234-script-find-replace-text-layer- names.html

  • 3d constraints - shape layer materials, missing front

    Hi,
    Im a newbie to 3d in PS CS6
    I have some text converted to a shape layer and then converted to New 3d Extrusion. I have all sides for materials instead of the front. The front seems to have broken into Boundary contraints, so was wondering is it possible to combine these as a shape to apply material. Sorry if this a basic question as Im just playing with this tutorial:
    http://www.photoshoptutorials.ws/photoshop-tutorials/text-effects/create-inspirational-3d- gold-text-photoshop-extended/
    Thanks
    lister

    anyway: without knowing what is the size of your doc, i'll give you a better workflow for editing etc:
    Open the image
    save it as a copy cylinderImage.psd
    create a new layer filled with black (for eg)
    select that layer and 3d / new shape from layer / cylinder
    then: in the 3d panel: select cylinder_material and right of diffuse click the tiny arrow and remove texture
    and then click the tiny arrow again and and load texture, browse and select the cylinderImage.psd you created earlier
    then if it goes to the top: click top_material and right of diffuse click the tiny arrow and remove texture
    it will jump to the cylinder part.
    this workflow may be longer but not hard and nearly foolproof
    G

  • A script for replacing texts only in selected layer?

    Hi all,
    I have an illustrator document which has many text layers. I have found the script below that replace a text with another one in the document;
    var doc = app.activeDocument;
    var myTextFrames = doc.textFrames;
    for (i = 0; i < myTextFrames.length; i++) {
    var myTF_ByI = myTextFrames[i];
    var str = myTF_ByI.contents
    var res = str.replace("word1", "word2");
    myTF_ByI.contents = res
    However, there is one problem that the script also replaces the text in other layers even though they are hidden or locked. Could you help me adjust this script to be effective only for the selected or unhidden layer?
    Cheers,
    Akin

    Hi elmagnifico,
    this is strange.
    Before running the script snippet:
    and after running the snippet:
    Can you show us your layers palette? Do you really layers mean – and not sublayers or not simple text items in one layer???
    regards

  • Reworking Photoshop layer renaming script for Illustrator

    The Photoshop scripting guru Paul R over at RetouchPro has created a really cool script to batch rename and number selected Photoshop layers. I haven't found anything similar on the Illustrator side.
    He's given permission for me to post it here in my hopes that some Illustrator scripting genius could come up with a similar script for Illustrator. Would it be terribly difficult to convert this into something Illustrator could use?
    http://www.mediafire.com/file/g7usr73u0236p0a/Rename_&_Renumber_Selected_Layers.jsx
    http://www.mediafire.com/file/dbah74x13bsa74c/Rename_&_Renumber_Selected_Layers.jsx.zip

    Hola Julio, I updated the script to rename visible Layers or Sublayers, and also fixed the Color
    #target illustrator
    main();
    function main(){
        if(!documents.length) return;
        //var allLayers = app.activeDocument.layers;
        var win = new Window( 'dialog', '' );
        g = win.graphics;
        //  var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.99, 0.99, 0.99, 1]); // CS5
        var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.50, 0.50, 0.50, 1]); // CS6
        g.backgroundColor = myBrush;
        win.orientation='stack';
        win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"});
        win.g1 = win.p1.add('group');
        win.g1.orientation = "row";
        win.title = win.g1.add('statictext',undefined,'Rename Visible Layers or Sublayers');
        win.title.alignment="fill";
        var g = win.title.graphics;
        g.font = ScriptUI.newFont("Georgia","BOLDITALIC",22);
        win.g5 =win.p1.add('group');
        win.g5.orientation = "column";
        win.g5.alignChildren='left';
        win.g5.spacing=10;
        win.g5.st1 = win.g5.add('statictext',undefined,'New layer name');
        win.g5.et1 = win.g5.add('edittext');
        win.g5.et1.preferredSize=[250,20];
        win.g10 =win.p1.add('group');
        win.g10.orientation = "row";
        win.g10.alignment='fill';
        win.g10.spacing=10;
        win.g10.st1 = win.g10.add('statictext',undefined,'Serial Number');
        win.g10.et1 = win.g10.add('edittext',undefined,'1');
        win.g10.et1.preferredSize=[50,20];
        win.g10.et1.onChanging = function() {
          if (this.text.match(/[^\-\.\d]/)) {
            this.text = this.text.replace(/[^\-\.\d]/g, '');
        win.g10.st1 = win.g10.add('statictext',undefined,'Length');
        var nums=[2,3,4,5];
        win.g10.dl1 = win.g10.add('dropdownlist',undefined,nums);
        win.g10.dl1.selection=0;
        win.g15 =win.p1.add('group');
        win.g15.orientation = "row";
        win.g15.alignment='fill';
        win.g15.cb1 = win.g15.add('checkbox',undefined,'Reverse layer order');
        win.g15.cb2 = win.g15.add('checkbox',undefined,'Rename Sublayers Only');
        win.g100 =win.p1.add('group');
        win.g100.orientation = "row";
        win.g100.alignment='center';
        win.g100.spacing=10;
        win.g100.bu1 = win.g100.add('button',undefined,'Rename');
        win.g100.bu1.preferredSize=[120,30];
        win.g100.bu2 = win.g100.add('button',undefined,'Cancel');
        win.g100.bu2.preferredSize=[120,30];
        win.g100.bu1.onClick=function(){
            if(win.g5.et1.text == ''){
                alert("No layer name has been entered!");
                return;
            win.close(0);
            var sublayersOnly = win.g15.cb2.value;
            var visibleLayers = [];
            getVisibleLayers (app.activeDocument, visibleLayers, sublayersOnly);
            if(win.g15.cb1.value) visibleLayers.reverse();
            for(b=0; b<visibleLayers.length; b++){
                var LayerName = win.g5.et1.text + zeroPad((Number(win.g10.et1.text)+Number(b)), Number(win.g10.dl1.selection.text));
                visibleLayers[b].name = LayerName;
        win.center();
        win.show();
        function getVisibleLayers(container, visibleLayers, sublayersOnly) {
            for(var a=0; a<container.layers.length; a++){
                var ilayer = container.layers[a];
                if (ilayer.visible) {
                    if (sublayersOnly) {
                        getVisibleLayers (ilayer, visibleLayers, false); // false to process only 1 sublayer depth
                    else
                    visibleLayers.push(ilayer);
    function zeroPad(n, s) {
        n = n.toString();
        while (n.length < s) n = '0' + n;
        return n;

  • I am using Windows XP and just installed Elements 12. When I try to select a different brush or shape the drop down list will not stay open long enough to select a different item. I have used Elements 9 for awhile and have not had this problem

    I am using Windows XP and just installed Elements 12. When I try to select a different brush or shape the drop down list will not stay open long enough to select a different item. I have used Elements 9 for awhile and have not had this problem

    grannybel
    It would appear that you are destined for the Adobe Photoshop Elements Forum since your question is related to Photoshop Elements and not Premiere Elements which is the focus program where you have posted.
    But, while the arrangements are being made, here are a few things for you to think about if you have not already
    1. Reset Tools - Select Brush Tool, then
    2. Delete Settings File
    Go to Full Editor/Edit Menu/Preferences/General and click on the option "Reset Preferences on Next Launch".
    We will be watching for your progress.
    Thank you.
    ATR

  • JS CS4: Create variable for current layer then select the layer at the end of a script

    I'm coming up blank with the verbiage and spinning my wheels with the OMV and script guide.
    var myOriginalLayer = app.activeDocument.layers.item(0);
    alert(myOriginalLayer)
    returns "object layer" and not the layer's name.
    var myOriginalLayer = app.activeDocument.layers.lastItem().name;
    Does return the layer name I want but not by selection.
    I'm challenged on how to select the layer.

    Hi John,
    The difference lies in that the [Object Layer] is the actual object, and the 'name' is just a property -- just like its color.
    You can use one of these two approaches:
    var myOriginalLayer = app.activeDocument.layers.item(0);
    alert(myOriginalLayer.name);
    will hold the original layer object, and you can see the name if required :-)
    To re-select the layer, use
    app.activeDocument.activeLayer = myOriginalLayer;
    Alternatively, selecting by name goes like
    var myOriginalLayerNAME = app.activeDocument.layers.lastItem().name;
    app.activeDocument.activeLayer = app.activeDocument.layers.item(myOriginalLayerNAME);
    I also noticed the following:
    app.activeDocument.layers.item(0) points to the first layer of your document; not the 'active' one. Similarly, app.activeDocument.layers.lastItem() just points to the very last one. I'm not sure if the order of the activeDocument.layers array mimicks the order as shown in the Labels palette, but I would hope it does :-)
    To get/set the active layer, use app.activeDocument.activeLayer as shown above.

  • Needed:  Script for importing Photoshop layers, converting to shape layers

    I've uncovered what seems to be a "bug" in After Effects CS5.  When I import photoshop artwork in layers, and then try to apply effects to an individual layer, such as a color change, a drop shadow, or pretty much anything including puppets, when I later try to render the movie, it crashes.
    My solution has been to laborously go through and convert any layer where I need to apply effects into an AE shape layer, copy the mask over, etc.  Its not much fun, but it does solve the bug.
    I know this could be done with a script, but I don't have the chops or the time to write it.
    Has anybody else written such a script?
    In essence, it needs to:
    1.  import a Photoshop file in layers.
    2.  select each layer in the file and
    3. create an AE layer
    4.copy the mask from the PS layer and
    5. paste it onto the AE layer.
    6. keeping the same registration and
    7. keeping the color of the PS layer.
    Easy, huh?  For somebody who knows what they're doing, which doesn't include me.....
    :<)McFrisco

    Wouldn't it be just more efficient if you provided one of your crashing PSDs along with the AE project so we can check and verify? If you contact me off-forum I can assure you confidentiality and even provide you with an upload location. I even looked up your otehr threads, but I feel we never really reached a point where we could make out something definite, so rather than trying to fix things the hard way, it may make more sense to let someone take a look. This may be something trivial, after all and be perfectly fixable by doing something differently...
    Mylenium

Maybe you are looking for

  • Muse crashes every time I try to open a project.

    I was working on a file this morning and saved it on my desktop I then went to open it on my laptop and Muse crashes every time I try to open it.

  • New Retina Macbook Pro - strange whining Sound

    Hi, i just received my new Macbook Pro Retina - brilliant machine. But suddenly it starts to whine - I can hear the whining while sitting in front of the notebook, so its pretty loud. The sound does appear when I move windows or enter mission control

  • OWB Process Flow and Mapping Differences

    IHAC where we have a mapping which produces two different operations depending on how the mapping is called from the Deployment Manager. When you call the mapping as an individual job an INSERT is performed. However, when the SAME MAPPING is called a

  • Flash sort of installs but doesn't work

    It seems to install it shows the ocx file in my flash folder and the plugin in the browser but will not open flash movies or flash content.. I know for a fact it's my flash because no flash items will show up, the test page also is a no show. I have

  • BADI or userexit for MIGO transaction

    hi All,               I have a requirement to enhance the MIGO transaction subscreen 304. In subscreen 304 there is only check box ITEM_OK. In the MIGO at the bottom of the screen ,whenver we click on item_OK check box and press enter, in the line it