Script to rename work with layer names plans

I want to create a script to rename lots a number of work plans.

-J' have 100 named layer.

-J' have 100 work plans.

-I would like to rename work plans to match the layer names.

-Layers are organized in the same descent orderas work plans (ignoring the names real artboard *).

-The plan of work in the foreground (1 in the list) would be renamed "Journal", the second plan of work would be renamed "typewriter", the third work plan would be renamed "books", etc..

* in the example below, the artboard named 'Graphic Board 7' is actually the 6th work plan in the list.

LayerNames-To-Artboards.png

Any help would be wonderful.

Hi sensibleworld, welcome to the forum.

For your case, it should be fairly simple. The following excerpt from script bit renames work plans to match the corresponding layer names that you described in your first post above. It only works if the number of layers and work plans correspond to such indicated and talked about in your above description of requirements.

if (app.documents.length == 0) {
    alert("No Open / Active Document Found");
} else {
    var doc = app.activeDocument;
    if (doc.artboards.length == doc.layers.length && doc.layers.length == doc.artboards.length) {
        for (var i = 0, l = doc.artboards.length; i < l; i++) {
            var ab = doc.artboards[i];
            ab.name = doc.layers[i].name;
        }
        alert("Finished:\nRenaming of Artboards to match Layer names is complete");
    } else {
        alert("Opps: This wont work!\n The number of Layers and Artboards do not match");
    }
}

I hope that this is useful for your efforts and your requirements. Welcome back to the forum.

Tags: Illustrator

Similar Questions

  • script to rename files with similar names?

    Hi, people.

    I have my RAW files in a single folder and my derivative images (e.g., PSD, TIFF, JPEG) in another.  The derived files share only the last four digits of the names of RAW files (for example, the RAW file is named 100826 - 14278.CR2 but the JPEG version is only named 4278.JPG).  In addition, the derived files have no metadata.

    Is it possible to use a script to match all derivatives for the last four digits-based RAW files, then change their file names to match the names of RAW.  And, if possible, can bridge waterfall then metadata less camera EXIF data in the RAW files for derived files?

    Thank you!

    -Greg

    P.S. My knowledge of scripting languages stops with cursive handwriting, so please, be gentle.

    Copy and paste the script in Extendscript Toolkit
    This utility is located in the proper folder: -.
    PC: C:\Program Files\Adobe\Adobe utility
    MAC: /Applications/Utilities/Adobe utilities

    Start Bridge - Edit - Preferences - Startup Scripts - Click "reveal my Startup Scripts.
    This will open the folder where the script should be saved.
    (It's just a text file with the extension .jsx)
    Close and restart Bridge and accept the new script.

    You will now see a new menu item 'Metadata' select 'Rename and add metadata' in the menu.
    It will now give you the option to select the folder of raw files and the folder of derived files, it then do rename it and add metadata (I hope).

    It may be preferable to set up a couple of test files and see if it works well.

  • OAuth.create_client and oauth.update_client does not work with several names of privilege

    For our REST services we have implemented a number of privileges.

    Each right is defined for a number of roles.

    So, we have the same problem as described here: Client OAUTH with more of a privilege

    Documentation of OAuth (pdf) package differs from oauth package specification in the database.

    We run on Oracle Standard Edition 12.1.0.2.0 3.0.2.294.08.40 ADR.

    Test cases running in questions:

    Create:

    Meets the exception, because the privilege name table is not extended.

    Start (oauth.create_client)

    p_name = > 'oauth shop. "

    p_grant_type = > 'client_credentials ',.

    p_privilege_names = > ' shop, test,

    p_support_email = > ' mailto:[email protected] ');

    end;

    Update1:

    Meets no exception, but does nothing.

    declare

    l_privileges t_ords_vchar_tab: = t_ords_vchar_tab();

    Start

    l_privileges. EXTEND (2);

    l_privileges (1): = 'unique ';

    l_privileges (2): = 'test ';

    () OAuth.update_client

    p_name = > 'oauth shop. "

    p_owner = > 'YOUROWNER ',.

    p_description = > NULL,

    p_redirect_uri = > NULL,

    p_grant_type = > 'client_credentials ',.

    p_privilege_names = > l_privileges);

    end;

    UPDATE2:

    Meets the exception, because the privilege name table is not extended.

    Start

    () OAuth.update_client

    p_client_id = > 10626,

    p_name = > 'oauth shop. "

    p_editing_user = > "Change user"

    p_allowed_origins = > NULL,

    p_description = > NULL,

    p_redirect_uri = > NULL,

    p_support_email = > ' mailto:[email protected] ',

    p_support_uri = > NULL,

    p_priv_names = > ' shop, test ");

    end;

    OAuth.rename_client does not work that way.

    It doesn't do anything.

    We could not work around the problem by using only a privilege by client because there is a unique uri models as key constraint ' / shop / *' ADR on the scheme.

    In this way it is impossible to create multiple privileges (each for a certain role) access to the same uri scheme.

    Is this a known issue?

    After some trial and error, we found a solution to our problem!

    According to the documentation, you will need to define a privilege name when you create a customer. But OAuth clients who obtain access through access client identifying information flow do not need privileges. Thus, we create customers with privilege names set to NULL now.

    What we do is to grant to the customer a specific role that is defined for specific privileges.

    Here are the reasons why we didn't get the question earlier. The token you generate a client is linked to the privileges given to the customer at the time that the token is generated.

    We have updated privileges customer and used the same token expect a different result, which was not the case. The rights are tied to the token on the creation of a token.

    We found out about it today and tested two-legged oauth clients (with a flow rate of access client_credential) with no particular privileges and only granted roles. Given that the roles granted privileges everything works as expected.

    Still leaves the ORA-error when providing separated by commas in the names of privilege to oauth.create_client and oauth.update_client.

    But our problem is solved.

    For completion. Here's a sample script that solves our problem:

    -create roles

    begin ords.create_role ('role.shop'); end;

    begin ords.create_role ('role.test'); end;

    -Create privileges of the shop, models and roles

    declare

    l_roles owa.vc_arr;

    l_patterns owa.vc_arr;

    Start

    l_roles (1): = "role.shop";

    l_roles (2): = "role.test";

    l_patterns (1): = ' / shop/pk / *';

    l_patterns (2): = ' / shop/gk / *';

    () ords.define_privilege

    p_privilege_name-online "priv.shop."

    p_roles-online l_roles,

    p_patterns-online l_patterns,

    p_label-online 'Shop Privilèges',

    p_description-online 'Shop Privilèges'

    );

    end;

    -create test templates and roles privileges

    declare

    l_roles owa.vc_arr;

    l_patterns owa.vc_arr;

    Start

    l_roles (1): = "role.test";

    l_patterns (1): = ' / test / *';

    () ords.define_privilege

    p_privilege_name-online "priv.test."

    p_roles-online l_roles,

    p_patterns-online l_patterns,

    p_label-online 'Privileges of Test',

    p_description-online "Test Prileges"

    );

    end;

    -create customer shop

    Start

    () OAuth.create_client

    p_name-online "oauth.shop."

    p_grant_type-online "client_credentials."

    p_privilege_names => NULL,

    p_support_email => ' mailto:[email protected]'

    );

    end;

    -create customer test

    Start

    () OAuth.create_client

    p_name-online "oauth.test."

    p_grant_type-online "client_credentials."

    p_privilege_names => NULL,

    p_support_email => ' mailto:[email protected]'

    );

    end;

    -to grant client roles

    begin oauth.grant_client_role ('oauth.shop', 'role.shop'); end;

    begin oauth.grant_client_role ('oauth.test', 'role.test'); end;

    commit;

    After doing that the access token for the client oauth.test and has access to

    -/ Shop/pk / *.

    -/ Shop/gk / *.

    -/ test / *.

    The access to the oauth.shop client token has access to

    -/ Shop/pk / *.

    -/ Shop/gk / *.

  • Script Java Application: WORK WITH FILES has BEEN DENIED?

    I've just updated Firefox v 17.0.1 when it restarted a message of Java said permission to work with files has been denied. I have never seen this before. Then I closed FF and reopened and the same message appeared again.
    (Note: this message was not there when I 1st FF open before I've updated)

    When the message appears, I'm still able to open and use the FF.

    To avoid confusion:

    Create a new profile as a test to see if your profile is the source of the problems.

    See "create a profile":

    If the new profile works then you can transfer files from a profile in the new profile, but make sure not to copy corrupted files.

  • Illustrator script to rename work plans according to the size of the artboard

    Hello

    I was wondering if anyone has a script that they would like to share that would rename all work plans in a document with their size?

    Thank you


    Eric

    Hi ericsoup,

    It works for your work plan [0]

    var AB = app.activeDocument.artboards[0];
    var ABR = AB.artboardRect;
    AB.name = (ABR[2] - ABR[0]).toFixed(3) + " points  × " + (ABR[1] - ABR[3]).toFixed (3) + " points";
    

    All you have to do is to add a loop through your work plans.

    Have fun

  • Script Export single Pages with the name and file custom paragraph Style?

    I have a document called "mydocument".

    I have a several pages in the document.

    Each page has a title of"style with a stylesheet called point title.

    I need to export each page as individual .jpg with a custom file name

    myDocument-01 - title.jpg

    01 is the page number

    Seemed like a simple request... but it turns out that it's a little challenging.

    This scipt below, that I found on another thread a little work

    It gives me a

    Title1.jpg

    But I can't figure out how...

    1. Add the name of "mydocument".

    2. have a 0 on the 1-digit numbers

    Can someone please guide me, I would be eternally grateful.

    if (app.documents.length != 0) {
         var myDoc = app.activeDocument;
        MakeJPEGfile();
    }
    else{  
         alert("Please open a document and try again.");  
    } 
    
    
    function MakeJPEGfile() { 
    
    
    
    
    
    
         for(var myCounter = 0; myCounter < myDoc.pages.length; myCounter++) {
    
              if (myDoc.pages.item(myCounter).appliedSection.name != "") {
                   myDoc.pages.item(myCounter).appliedSection.name = "";
              }
                
                var myPageName = myDoc.pages.item(myCounter).name;
              var myJpegPrefix = "";
              var isStyleExist = true;
    
              //Checking the existing of the paragraph style (filename)
              try {
                  myDoc.paragraphStyles.item("title");
              }
              catch (myError) {
                  isStyleExist = false;
              }
    
              if (isStyleExist)
    
    
              myJpegPrefix = getParagraphContent(myDoc.paragraphStyles.item("title"), myDoc.pages.item(myCounter)) + myPageName;
              app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.high; // low medium high maximum
              app.jpegExportPreferences.exportResolution = 72;
              app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
              app.jpegExportPreferences.pageString = myPageName;
    
    
              var myFilePath = "~/-client/JOYS - Just Organize Your Stuff/-Art/-art-book-kindle/" + myJpegPrefix + ".jpg";
              var myFile = new File(myFilePath);
              myDoc.exportFile(ExportFormat.jpg, myFile, false);
         }
    }
    
    
    // The new function, but needs to add checking the file name rules.
    
    
    function getParagraphContent (paragraphStyle, currentPage)
    {
        var paragraphContent = null;
        for (var c = 0; c < currentPage.textFrames.length; c++)
        {
            for (var i = 0; i < currentPage.textFrames.item(c).paragraphs.length; i++)
            {
                if (currentPage.textFrames.item(c).paragraphs.item(i).appliedParagraphStyle == paragraphStyle)
                {
                    paragraphContent = currentPage.textFrames.item(c).paragraphs.item(i).contents;
       // Remove spaces and returns at the end:
                    paragraphContent = paragraphContent.replace(/\s+$/, '');
       // Replace remaining spaces with hyphen:
                    paragraphContent = paragraphContent.replace(/\s+/g, '-');
       // Make lowercase:
                    paragraphContent = paragraphContent.toLowerCase();
                    return paragraphContent;
                }
            }
        }
        return paragraphContent;
    }
    
    

    Thank you Mi!

    One more step.

    I just need to remove the extension .indd.

    My file name is now

    myDocument.indd - 01 - title.jpg

    If (app.documents.length! = 0) {}

    myDoc var = app.activeDocument;

    MakeJPEGfile();

    }

    else {}

    Alert ("Please open a document and try again.");

    }

    function MakeJPEGfile() {}

    for (var myCounter = 0; myCounter< mydoc.pages.length;="" mycounter++)="">

    If (. appliedSection.name myDoc.pages.item (myCounter)! = "") {}

    myDoc.pages.item (myCounter).appliedSection.name = "";

    }

    var myPageName = myDoc.pages.item (myCounter) .name;

    var myJpegPrefix = "";

    var isStyleExist = true;

    Audit of the existing paragraph style (filename)

    try {}

    myDoc.paragraphStyles.item ("title");

    }

    {} catch (MonErreur)

    isStyleExist = false;

    }

    If (isStyleExist)

    myJpegPrefix = getParagraphContent (myDoc.paragraphStyles.item ("title"), myDoc.pages.item (myCounter)) + '-0 "+ myPageName;

    app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.high; low medium high maximum

    app.jpegExportPreferences.exportResolution = 72;

    app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;

    app.jpegExportPreferences.pageString = myPageName;

    var CheminMonFichier = "" ~/-client/JOYS - just organize your Stuff Art / /-art-book-kindle / "+" / "+ myDoc.name +"-"+ myJpegPrefix +".jpg";

    var myFile = new File (myFilePath);

    myDoc.exportFile (ExportFormat.jpg, myFile, false);

    }

    }

    The new feature, but it will add filename rules checking.

    function getParagraphContent (paragraphStyle, currentPage)

    {

    var paragraphContent = null;

    for (var c = 0; c)< currentpage.textframes.length;="">

    {

    for (var i = 0; i)< currentpage.textframes.item(c).paragraphs.length;="">

    {

    If (currentPage.textFrames.item (c).paragraphs.item (i) .appliedParagraphStyle is paragraphStyle)

    {

    paragraphContent = currentPage.textFrames.item (c).paragraphs.item (i) .silence;

    Remove the spaces and returns at the end:

    paragraphContent = paragraphContent.replace (/ \s+$ /, ");

    Replace the remaining spaces with hyphen:

    paragraphContent = paragraphContent.replace (/ \s + / g, '-');

    Make lowercase:

    paragraphContent = paragraphContent.toLowerCase ();

    Return paragraphContent;

    }

    }

    }

    Return paragraphContent;

    }

  • Brush on CS6 tool not working with layer masks - behave like an airbrush?

    Hello

    I use adjustment layers (curves) and create a layer dark / clear and then with a brush with an opacity of 30 to 50% to say to paint on the mask to show dark / clear in certain areas of an image.

    It was working fine until yesterday. Now however, my brush appeared pixelated and scattered on the spray paint or an airbrush for example. Rather than all the soft brush. Even at 100% opacity, not all pixels are altered, instead, ago clearly visible (when zoomed in) pixels which are lightened / darkened, and some were completely unchanged, which leads to a horrible pixelation effect.

    Any ideas? Thank you very much!

    Have solved - I got the 'mode' value dissolve rather than normal, for some reason any. Thank you

  • Change language script does not work with groups of styles

    I get documents CS5.5 in which paragraph styles are presented in groups. When I run this script http://forums.adobe.com/message/1913197 , it only works on the paragraph styles that are not in groups of styles. Can someone help me?

    This is because there is a difference in scope between 'paragraphStyles' and 'allParagraphStyles' (lists all paragraph styles (regardless of their group)).

    So changing:

    myStyles=myDoc.paragraphStyles;
    

    TO:

    myStyles=myDoc.allParagraphStyles;
    

    should do the trick (not tested with the script in the linked thread).

    It goes same for section character styles:

    //myStyles=myDoc.characterStyles;
    myStyles=myDoc.allCharacterStyles;
    

    Uwe

  • Difficulty working with the ground plane...

    I am using a ground plane with '+' style contact to the parties. With a width of talking to. 010 ", contact the parties in many places is too skinny, but its just for others. This fact prevents me to extend width talks to solve the problem.

    I tried to add traces of copper manually, but the plan of mass resists my efforts to redirect the traces or refusing to connect them to the plan altogether.

    How can I increase plan connection of parts, without forcing on them?

    Thank you very much, Tod

    Hi Tod,

    Him spoke with can be specified to SMT/THT pads. Normally, they are set to inherit the properties of the area related to copper, but you can change this on an individual basis.

    To change the width of speaks for a special touch:

    1. Check that only Edit > selection filter > activate by selecting Pads and Edit > selection filter > SMD by selecting activate Pads are checked (appears depressed)
    2. Select the key to be changed (you can drag to select more than one at a time
    3. Click Edit > properties
    4. Select the tab of thermal discharge
    5. Change talked about the width of your required
  • How can I change Script 8 to work with Windows 7 Pro 64 bit?

    I am running Windows 7 Pro 64-bit, to my knowledge, all of the computers for sale are now 64 bit, can I expect escription software to catch up? I need to run version 8 to edit the Script on this PC. I installed Microsoft Virtual PC and XP mode, but it does not recognize the USB devices. On the contrary, he acknowledges some, but not all. Not a pedal.

    I can't believe that Nuance has not improved its ability to software. ??

    Someone at - he found a solution to this problem?

    It is currently possible to buy computers running 32 or 64 bit Windows 7 version.  You can contact Nuance about their Upgrade: http://www.nuance.com/company/company-overview/contact-us/index.htm also, the following link to another thread discussing the same product may be useful: http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/escription-software-is-not-compatible-with-windows/65679085-c3a1-4978-b6ed-2d3d00fe3d76

  • If I was here and they reset my password. That works, but it requires a password to the final installation and my password in working with my name that appears is; Michael Dost not E-mail

    need to find the password to install final to Michael Dost

    When you install the software you is usually requested a password. This is not the Adobe password, or the password of any web site. It is the administrator password for your computer, that you (or someone) has chosen the first time you've turned on your computer. No one can tell you that it is, or to reset.

  • My script works with a #1009 error?

    Hi all

    I spent so much time trying to understand and I do not understand, I have this script where the error #1009 is displayed continually, the stange thing: my script works correctly and I want to get quotes off the coast of this error. When my script is 'correct', which means, no more errors appear, the script does not work with the external swf. The target of the red error 'movie01' in the script, but this reference was already used successfully, why not this one?

    This script works but with the error #1009:

    var movie02:Loader = new Loader();

    movie02. Load (new URLRequest("test/seq.swf"));

    addChild (movie02);

    movie01.addEventListener (Event.ENTER_FRAME, seq01);

    function seq01(main:Event):void {}

    var movie01:MovieClip = main.target.content;

    If {(this.currentFrame is 15)

    movie01. Play();

    }

    If (movie01.currentFrame == 150) {}

    This.Stop ();

    }

    }

    Thank you

    Alain

    :

    var movie01:Loader = new Loader();
    movie01.contentLoaderInfo.addEventListener (Event.Complete, LoadComplete);
    movie01. Load (new URLRequest("test/seq.swf"));
    addChild (movie01);

    movie01.contentLoaderInfo.addEventListener (Event.Complete, LoadComplete);
    function loadcomplete(e:Event) {}
    movie01.addEventListener (Event.ENTER_FRAME, seq01);
    }

    var exectedPreviously:Boolean

    function seq01(main:Event):void {}
    var mc:MovieClip = MovieClip (main.target.content);
    If (this.currentFrame == 15 &! executedPreviously) {}

    executedPreviously = true;
    MC. Play();
    }
    If {(mc.currentFrame is 150)
    This.Stop ();
    }
    }

  • Why this scriipt does not work with Firefox? &lt; embed src = "News2008Fall.pdf" width = '615' height = '3200' &gt; &lt; / embed &gt; "

    Please tell me why this script does not work with Firefox. It works with Safari. Here is the page that includes the script: www.lionsgatehoa.org/newslettertest.html. Thank you. Tom Engleman

    Here's the script in my html document:

    < embed src = "News2008Fall.pdf" width = '615' height = '3200' > < / embed > "

    Edit: removed # phone

    Works for me on Linux.

    Your system details list does not display the Adobe Reader plugin, so you'll have to (re) install this program.

    See:

  • Sourcing rule works with min - max?

    Hello

    (1) Will Sourcing rule works with min - max planning? How?

    (2) and how you decide who use elements of planning elements u and wich Min - max, to the point of replenishment of development?

    Published by: 832641 on February 4, 2011 19:35

    (1) Yes, sourcing will work in the same way that it works with other sources such as kanban, etc. of the PSO. You must define the ASL for the rule point and sourcing with the corresponding transfer game.

    (2) according to my understanding logically point re - order is nothing but Min - Max, min, and max equal to Min value of the stock you want to maintain for the item

  • A Script to find and replace the layer names

    Is there scripts to find and replace the names of layers?

    There is an excellent script available for Photoshop that allows you not only to replace words in layer names, but also insert words as prefixes, Suffixes and sequential numbers.

    The version of the illustrator of this script allows only sequential numbering: it does not offer search and replace words.

    Ideally, it would be great if there were something that could find multiple and replaces in a go:

    (for example

    You have layers like this car, the dog, the bat

    You enter: because (Option1), dog (Option2), Bat (Option3)

    Your layers become then: option 1, option 2, Option3).

    )

    Big_SmiLe, which is a very good start! Step 1 of learning how to Script is indeed, by adjusting an existing simple script to make things more complicated. (And usually then "break something", which is also a necessary part of the process.)

    You are right your comment, it comes to repetitive things. For one or two different articles that wouldn't be a problem, but in the longer lists you are soon lost.

    As usual to work with lists of search - replace is to build a table:

    var layernames = [
    [ 'FHairBowlBoy *Hair', 'Hairboy1' ],
    [ 'FHairCurlyafroBoy *Hair', 'Hairboy2' ],
    [ 'FHairSpikyBoy *Hair', 'Hairboy3' ],
    ];
    

    The general idea is to loop through all the names, check if the current layer name is "layernames [i] [0]" (the left column) and if so, rename it "layernames [i] [1]" (the right column). If you know how to write a loop in Javascript, then you can implement this immediately.

    However...

    A more advanced method to do this didn't need even loop on all layernames - instead you can immediately 'get' the correct name by layer! It's magic! Almost!

    The trick is to use a Javascript object rather than a table. JavaScript objects are nothing special; "Layers" of Illustrator are an array of objects, and each object 'sex' has a 'name' property, which you can read and set the value. What I do here, is to create a new object, where the part 'name' is the name of the original layer and its value is the name of the new layer. All you need to check each layer is if there is a "object.originalLayerName" property and if so, assign its value to this layer name.

    It looks a bit like the table above, except that (1) you use {.} instead of [..] to create an object and (2) you add pairs "name: value" instead of 'value' only (in fact, the 'name' of a value in a table is simply her number).

    So here's what it looks like:

    // JavaScript Document
    var doc = app.activeDocument;
    // name indexed object
    var layernames = {
     'FHairBowlBoy *Hair':'Hairboy1',
     'FHairCurlyafroBoy *Hair':'Hairboy2',
     'FHairSpikyBoy *Hair':'Hairboy3'
    };
    // loop through all layers
    for (var i = 0; i < doc.layers.length; i++)
    {
     //Set up Variable to access layer name
     var currentLayer = app.activeDocument.layers[i];
     if (layernames[currentLayer.name])
     {
      currentLayer.name = layernames[currentLayer.name];
     }
    }
    

    Enjoy!

Maybe you are looking for