Rename Layer, Group, Object Javascript

Hey Guys,
I'm trying to write a script that renames a layer, and group within the layer, then an object within the layer (but not a part of the group) and have it run in a loop.
Here's what I've got so far, the group rename doesn't work.
#target Illustrator
var doc = app.activeDocument;
idLayers(doc)//IRename layers
idGroups(doc)//Rename groups
function idLayers(doc){
    for(i=0;doc.layers.length>i;i++){
        doc.layers[i].name= 'id:GTM_Group '+(i+1)
function idGroups(doc){
    for(i=0;doc.groups.length>i;i++){
        doc.groups[i].name= 'id:GTM_Group '+(i+1)
I haven't put in anthing to rename the single object yet since I cant even get the group rename to work. I suspect that the group re-name section isn't working because I'm either using bad syntax or an invalid command. Any ideas?

Found out that I was really close, and some interesting facts about how thorough illustrator will be when renaming groups across the board. Basically the files I'm working with have a layer that requires a specific name and number, and group within that layer and an object outside of that group but still in the same layer. Within the group is a compound path made up of several objects, I noticed that the when I started getting the group rename working it was skipping multiple numbers because it was going inside the compound path, find groups within the compound path and renaming them as well. So as long as I make sure there are no groups hidden within the groups I wanted to rename the script  works like a charm.
Anyway this is what that script looks like I'm still working on getting the up-grouped object renamed. I notice this discussion has gotten a few views since I went to lunch. I'll post the final version at the end of the day if I have time.
If anyone has any suggestions or constructive advice I'd be very open to hear it.
#target Illustrator
var doc = app.activeDocument;
idLayers(doc)//IRename layers
idGroups(doc)//Rename groups
function idLayers(doc){
    for(i=0;doc.layers.length>i;i++){
        doc.layers[i].name= 'Named Layer  '+(i+1)
function idGroups(doc){
    for(i=0;doc.groupItems.length>i;i++){
        doc.groupItems[i].name= 'Named Group '+(i+1)

Similar Messages

  • Layer group blending modes

    There was some discussion about defaulting layer groups blending mode being normal by default instead of pass through. While I do use a lot of smart objects as "normal" containers (albeit mostly to filter rather than blend), I'm interested in techniques which would make normal a more useful default. Any thoughts?

    OK... Here's my 2 cents. I use layer sets (layer groups) often in color correction work. Some times to get color where you want it, you may need to use 2 or 3 adjustment layers. For instance a Hue Saturation layer and a Curve layer. rather tan masking both of them, I put them into a layer set, and make one mask at the set level. This is helpful if later you need to extend the correction to include additional areas... all you need to do is modify one mask. In this situation, the layer set has to be set to pass through in order to affect pixels below it.
    Now, lets say I grabbed a head from a different image, to add a person to the image I started with. If the head requires brightening and color adjustments to make it match the existing image, I find it a little neater to place the head layer in a layer set, then all the adjustment layers can go inside the set with it. But I need the blend mode of this set to be normal, so that the effects of the adjustment layers within it do not continue past the set level. Make sense?
    I realize that you can link the adjustments to the layer you intend to affect, but I find the method I described to just be a little neater as far as layer management. AND if I then need to paint in hair for the head layer and paint in some eye enhancements, I can do each on its own layer inside the set. Sometimes I'll make the blend mode of the layer set for the head (just to stick with the same example) normal then put all my color adjustment layers inside a sub set with a blend mode of pass through. Then I can mask the CC layer set to only CC the eyes let's say, and I can mask the head layer set separately to blend it into the scene.
    I hope all that helps. :^)

  • Transport Layer and Objects

    what is the relation between the objects of a transport request and the layers in a transport domain?

    Dear Abhishek,
    First of all a I have to explain packet:
    Packet
    A packet groups Objects of the Development. Any report or table or data element … belongs to a packet. So every repository element is connected with a packet.
    Transport route
    A transport route describes the direction a transport can be transported. For example if you want to transport a transport from development to a test system, you have to configure in TMS a transport rout from development to the test system.
    Transport layer
    A transport layer connects packets to transport routes.
    The connection between packet, transport route and transport layer is:
    Objects of Development (Programs or Reports or Tables …) <-> packets <-> transport layer <-> transport route <-> systems
    If you develop a report in development system and want this report to be transported to the test system you need:
    -to connect the report with a packet.
    -to connect this packet with a transport layer
    -to connect this transport layer to the transport route that is connected to the both system and describes the direction FROM(development system) TO(test system)
    For an exact description see:
    http://help.sap.com/saphelp_nw04/helpdata/EN/57/38de0c4eb711d182bf0000e829fbfe/content.htm
    Best regards
    Willi Eimler

  • Photoshop CS5 Hangs on Layer Group name edits

    Layer Group name edits are causing my PS CS5 to hang repeatedly. At first I thought it was the document I was working in, so I created a generic document, and was able to replicate the problem in the new document.
    With a .psd open, in the layers pallete, I have a Layer Group (A) that contains multiple sub layer groups (B) which contain additional sub layer groups (C). So the hierarchy is a three level layer group. At the sub-most layer group (C) I need to rename the groups to "Three-set colors". Since I have fifteen groups that all need the word "Three" in their labels, it would be most convenient to be able to highlight the word "Three", copy to clipboard and paste. I type in the word "Three" in the layer group name (not in the properties insector) and highlight the word "Three". Thats when PS CS5 hangs, and I have to reboot my system to unfreeze Photoshop. Only Photoshop hangs, the system does not crash. This happens in both 64 and 32 bit, old or new docs.
    The plugins I have are Mask Pro x64 (OnOne) and Sitegrinder x32 (Medialab), but they are not activated when the hang occurs.
    Any ideas?
    PS CS5 12.01 x64
    Win 7 Ultimate
    12 gb ram
    i7 960 @ 320
    ATI Radeon HD 5700
    4x HD's

    I wasn't able to reproduce the problem with either Photoshop CS5 32 bit or x64.  That says there's something different about our systems, and that there's likely not a systemic problem in Photoshop.
    Chris Cox, who replied above, is an Adobe Engineer, by the way.
    I was able to replace parts or all of the names with, or insert the word Three in front of existing layer names.
    Are you seeing any errors in your Windows system logs at the time the hang is occurring?
    Have you updated all your software (e.g., video drivers, Windows Updates, etc.)?
    -Noel

  • Importing PSD with Layer-Groups in AE - No align Anchor Point

    Hey folks!
    I am importing a PSD file into AE.
    This PSD includes "normal layers" and "layer-groups".
    At the import-dialouge i choose "Footage Dimension: Layer Size", to get the anchor point in the center of my objects.
    This works just fine in case of the "normal layers", but the "layer-groups" (wich turn into comps in AE) didn't have an align anchor point. Instead of this it is in the center of the whole PSD-file.
    Is there any trick to handle this problem?
    Thanks a lot!

    That's a limitation you have to live with. After all, the PSD dimensions are used for the comp size and in PS groups are just that - organizational structures, not real transform hierarchies, so there is no persistent information.
    Mylenium

  • Animating position of layer group using timeline

    is it possible to change position of a layer group in new timeline? I only see opacity keyframes. Seems like I can convert to smart object to do it, but rather not do that.

    Do you want to move the grouped layers on the page, or their position in the layer stack? Can you also clarify "New timeline"?  It kind oof reads that you have the group in an exisiting timeline, and want to use them again in a 'new' timeline.

  • Error while creating MV replication group object

    Hi,
    I am getting error while creating replication group object. I tried to create using OEM and SQLPlus
    OEM error
    This error while creating M.V. rep. group object
    There is a table or view named SCOTT.EMP.
    It must be dropped before a materialized view can be created.
    In SQLPLUS
    SQL> CONNECT MVIEWADMIN/MVIEWADMIN@SWEET
    Connected.
    SQL>
    SQL> BEGIN
    2 DBMS_REPCAT.CREATE_MVIEW_REPOBJECT (
    3 gname => 'SCOTT',
    4 sname => 'KARTHIK',
    5 oname => 'emp_mv',
    6 type => 'SNAPSHOT',
    7 min_communication => TRUE);
    8 END;
    9 /
    BEGIN
    ERROR at line 1:
    ORA-23306: schema KARTHIK does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 2840
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 773
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 5570
    ORA-06512: at "SYS.DBMS_REPCAT_SNA", line 82
    ORA-06512: at "SYS.DBMS_REPCAT", line 1332
    ORA-06512: at line 2
    Please not already I have created KARTHIK schema.

    Arthik,
    I think I know what may have happened.
    As I can see you are trying to create support for an updateable materialized view.
    You have to make sure the name of the schema that owns the materialized view is the same as the schema owner of the master table (at master site).
    From the code you have shown, I bet the owner of table EMP is SCOTT.
    From the other hand, you want to create materialized view EMP_MV under schema KARTHIK that refers to table SCOTT.EMP at master site.
    According to the documentation, the schema name used in DBMS_REPCAT.CREATE_MVIEW_REPOBJECT must be same as the schema that owns the master table.
    Please check the documentation at the link below
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14227/rarrcatpac.htm#i109228
    I tried to reproduce your example in my environment, and I got exactly the same error which actually confirms my assumption that the reason for the error is the fact that you tried to create the materialized view in a schema with different name than the one where master table exists.
    I'll skip some of the steps that I used to create the replication environment.
    I have two databases, DB1.world and DB2.world
    On DB2.world I will generate replication support for table EMP which belongs to user SCOTT
    SQL> conn scott/*****@DB2.world
    Connected.
    SQL>create materialized view log on EMP with primary key;
    Materialized view log created.
    SQL>
    SQL>conn repadmin/*****@DB2.world
    Connected.
    SQL>BEGIN
      2       DBMS_REPCAT.CREATE_MASTER_REPGROUP(
      3         gname => 'GROUPA',
      4         qualifier => '',
      5         group_comment => '');
      6*   END;
    PL/SQL procedure successfully completed.
    SQL>BEGIN
      2       DBMS_REPCAT.CREATE_MASTER_REPOBJECT(
      3         gname => 'GROUPA',
      4         type => 'TABLE',
      5         oname => 'EMP',
      6         sname => 'SCOTT',
      7         copy_rows => TRUE,
      8         use_existing_object => TRUE);
      9*   END;
    10  /
    PL/SQL procedure successfully completed.
    SQL> BEGIN
      2       DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT(
      3         sname => 'SCOTT',
      4         oname => 'EMP',
      5         type => 'TABLE',
      6         min_communication => TRUE);
      7    END;
      8  /
    PL/SQL procedure successfully completed.
    SQL>execute DBMS_REPCAT.RESUME_MASTER_ACTIVITY(gname => 'GROUPA');
    PL/SQL procedure successfully completed.
    SQL> select status from dba_repgroup;
    STATUS                                                                         
    NORMAL                                                                          Now let's create updateable materialized view at DB1. Before that I want to let you know that I created one sample in DB1 user named MYUSER. MVIEWADMIN is Materialized View administrator.
    SQL>conn mviewadmin/****@DB1.world
    Connected.
    SQL>   BEGIN
      2       DBMS_REFRESH.MAKE(
      3         name => 'MVIEWADMIN.MV_REFRESH_GROUPA',
      4         list => '',
      5         next_date => SYSDATE,
      6         interval => '/*1:Hr*/ sysdate + 1/24',
      7         push_deferred_rpc => TRUE,
      8         refresh_after_errors => TRUE,
      9         parallelism => 1);
    10    END;
    11  /
    PL/SQL procedure successfully completed.
    SQL>   BEGIN
      3       DBMS_REPCAT.CREATE_SNAPSHOT_REPGROUP(
      5         gname => 'GROUPA',
      7         master => 'DB2.wolrd',
      9         propagation_mode => 'ASYNCHRONOUS');
    11    END;
    12  /
    PL/SQL procedure successfully completed.
    SQL>conn myuser/*****@DB1.world
    Connected.
    SQL>CREATE MATERIALIZED VIEW MYUSER.EMP_MV
      2    REFRESH FAST
      3    FOR UPDATE
      4    AS SELECT EMPNO, ENAME, JOB, MGR, SAL, COMM, DEPTNO, HIREDATE
      5*      FROM   [email protected];
    Materialized view created.
    SQL>conn mviewadmin/******@DB1.world
    Connected.
    SQL> BEGIN
      2       DBMS_REFRESH.ADD(
      3         name => 'MVIEWADMIN.MV_REFRESH_GROUPA',
      4         list => 'MYUSER.EMP_MV',
      5         lax => TRUE);
      6    END;
      7  /
    PL/SQL procedure successfully completed.And now lets run CREATE_MVIEW_REPOBJECT.
    SQL>   BEGIN
      2       DBMS_REPCAT.CREATE_MVIEW_REPOBJECT(
      3         gname => 'GROUPA',
      4         sname => 'MYUSER',
      5         oname => 'EMP_MV',
      6         type => 'SNAPSHOT',
      7         min_communication => TRUE);
      8    END;
      9  /
      BEGIN
    ERROR at line 1:
    ORA-23306: schema MYUSER does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 2840
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 773
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 5570
    ORA-06512: at "SYS.DBMS_REPCAT_SNA", line 82
    ORA-06512: at "SYS.DBMS_REPCAT", line 1332
    ORA-06512: at line 3 I reproduced exactly the same error message.
    So the problem is clearly in the schema name that owns the materialized view.
    Now lets see if what would happen if I create the MV under schema SCOTT which has the same name as the schema on DB2.world where the master table exists.
    SQL>conn scott/****@DB1.world
    Connected.
    SQL>CREATE MATERIALIZED VIEW SCOTT.EMP_MV
      2    REFRESH FAST
      3    FOR UPDATE
      4    AS SELECT EMPNO, ENAME, JOB, MGR, SAL, COMM, DEPTNO, HIREDATE
      5*      FROM   [email protected];
    Materialized view created.
    SQL>conn mviewadmin/******@DB1.world
    Connected.
    SQL> BEGIN
      2       DBMS_REFRESH.ADD(
      3         name => 'MVIEWADMIN.MV_REFRESH_GROUPA',
      4         list => 'SCOTT.EMP_MV',
      5         lax => TRUE);
      6    END;
      7  /
    PL/SQL procedure successfully completed.And now lets run CREATE_MVIEW_REPOBJECT.
    SQL>   BEGIN
      2       DBMS_REPCAT.CREATE_MVIEW_REPOBJECT(
      3         gname => 'GROUPA',
      4         sname => 'SCOTT',
      5         oname => 'EMP_MV',
      6         type => 'SNAPSHOT',
      7         min_communication => TRUE);
      8    END;
    PL/SQL procedure successfully completed.As you can see everything works fine when the name of the schema owner of the MV at DB1.world is the same as the schema owner of the master table at DB2.world .
    -- Mihajlo
    Message was edited by:
    tekicora

  • Grouped objects not saved correctly

    I group objects (graphics and text), save the file, but when I open it again, grouped objects are moved, sometimes outside the slide. This seems to affect graphics dropped onto keynote, and only of they are grouped. Graphics & text produced inside keynote, using its graphing tools are displayed correctly.
    Anyone sees the same behavior? More importantly, anyone has a fix?
    Keynote 08
    OS 10.6.2

    Hi,
    I noticed that I can not change the precision on a column in one of my tablesProbably that's a FK column.
    For the other problem - probably it's caused by merge conflict and you have in the file symbols <<<<<< >>>>>> and non valid XML elements. You can try to replace the content of the file manually using version from repository. There will be better processing of suche cases in next release.
    Philip

  • Photoshop CC 2014 hangs for nearly 15 seconds when using Layer Group Layers or Layer Palette Group from Layers commands.

    Photoshop hangs for nearly 15 seconds when using Layer > Group Layers or Layer Palette > Group from Layers commands. NOT on creating new group and creating layers and drag-n-dropping layers into group manually in Layer Palette. Got a UI design file with nearly 800 layers and lot of groups. This doesn't occur in smaller files. Using OS X Mavericks, Photoshop CC 2014.2.2, Mid 2014 15-inch Retina Macbook Pro.
    I understand that the solution would be just to cut the file into smaller files and design each UI view in a separate file but that would be painful. And it does not seem to be a very hard task to just group layers.

    Does the document also have a lot of layer comps?
    And can you post that document or send me a copy of it so we can see exactly why it is hanging?

  • I want to find the image tag name from Image layer name InDesign JavaScript?

    I want to find the image tag name from Image layer name InDesign JavaScript?

    Hi,
    You can use following script to fetch image tag name and the layer name on which it lie:
    var imgBox = app.activeDocument.rectangles // fetch all rectangular frames from the active document
    for(var i = 0; i< imgBox.length; i++)
      if(null != imgBox[i].associatedXMLElement )
                var b = imgBox[i]
               alert("Image tag name "+imgBox[i].associatedXMLElement.markupTag.name + "\n exist on layer " + imgBox[i].itemLayer.name)
    Hope this would help you to resolve your problem.

  • Can't rename layer in PSE 11

    When I click on the name edit box of a layer in the layers palette it changes from grey to white then immediately changes to grey and I cannot type into it. The same thing happens if I right click the layer and choose Rename Layer from the context menu. What must I do to rename a layer? This worked perfectly in PSE 9 but seems to be a bug now. Thanks.

    Which platform, which version of your OS? It works for me. Try deleting the preferences: go to the editor preferences>general and click this button, then restart the editor:

  • Can't group objects in Captivate?

    Why no option to "group" objects in Captivate? -- not only is this standard in vector graphics programs (Freehand, Illustrator, Flash, even in Word), it's necessary for efficient editing.

    Hi there
    You may group, but the grouping is temporary.
    Note that Captivate is not a vector application. Instead it is a raster based applicaton. Perhaps that explains it?
    If you really would like to see it emerge as a future option, please submit a Wish Form to ask for it.
    Click here to visit the Wish Form/Bug Reporting Form
    Cheers... Rick
    Click here for Adobe Certified Captivate and RoboHelp HTML Training
    Click here for the SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • Importing layer groups from photoshop to flash cs4

    Hi everyone,
    I have about 5 layer groups in Photoshop and in each of the groups/folders there are some layers with some text and other layers with isolated images and also layers with some layer styles. When I import this file into Flash I need each of the layer groups to be imported as a flattened bitmap image. I don't want any of the text to be editable or to have any of the layer styles intact. So if there are 5 layer groups in Photoshop, I just need five bitmap images in flash. I've tried doing this but it still imports the layers separately. I know I can flatten the groups in Photoshop but I want to keep this file editable.
    Does anyone know how to do this?
    Appreciate any help.

    Harry Kunz wrote:
    Then why not flatten it (BUT not save it) and import it into flash THEN revert the photoshop file (CTRL+Z) so it will still be editable version?
    Yeah I know that's an option but I just thought there might be a quicker way, but maybe not.
    Thanks for the suggestion though.

  • How do I rename a group of photos ?

    I can t find a way to rename a group of photos at the same time as I did in Aperture. Has anyone a solution ?

    There isn't a Batch Change option
    http://www.apple.com/feedback/macosx.html
    And tell them you want one.

  • CP5 - W7 - Nested/Grouped objects - Not possible

    Hi dear community,
    I use Photoshop, Premiere, after effects, and many other adobe produts...
    All of them have something in common, you can group or nest objects, vector based or pixel based media does not matter.
    In Premiere, yoy can group a film a title and some effects into a cilp, and then use that clip as a object.
    In Photoshop you can create folders under layers and use those to manage several objects at once.
    But what about captivate? Even the "not to be mensioned here PowerPoint" can group objects.
    Why is it so that within a company one does not reuse smart ideas and maby code?
    Do not get me wrong, I love all the posibilities with captivate, but explode sometimes on the small unessesary to forget to develop things.
    And to you who want to tell me about SHIFT, that is not what I am talking about
    Thank you for reading!
    // Daniel

    Hello,
    Sorry for that, must have been tired. The link is in the main page of these CP-forums, but here you have it too:
    Feature Request Form
    Lilybiri

Maybe you are looking for