Script to make the list of layer names.

I wonder if someone could help me make the simple script that take the layer names and the list of their share on the A4 in canvas.

Now I just got the screenshot of the list of Illustrator and edit it through photoshop to print, but it is too small, because each file have a approximately 25-50 layers.

Looks like this:

layer-list.jpg

I tried to edit the script of John Wundes, which makes the list of the nuances, but it seems difficult for my skills.

/////////////////////////////////////////////////////////////////
// Render Swatch Legend v1.1 -- CS, CS2, CS3, CS4, CS5
//>=--------------------------------------
//
//  This script will generate a legend of rectangles for every swatch in the main swatches palette.
//  You can configure spacing and value display by configuring the variables at the top
//  of the script. 
//   update: v1.1 now tests color brightness and renders a white label if the color is dark.
//>=--------------------------------------
// JS code (c) copyright: John Wundes ( [email protected] ) www.wundes.com
// copyright full text here:  http://www.wundes.com/js4ai/copyright.txt
//
////////////////////////////////////////////////////////////////// 
    doc = activeDocument,
    swatches = doc.swatches,
    cols = 4,
    displayAs = "CMYKColor",  //or "RGBColor"
    rectRef=null,
    textRectRef=null,
    textRef=null,
    rgbColor=null,
    w=150;
    h=100,
    h_pad = 10,
    v_pad = 10,
    t_h_pad = 10,
    t_v_pad = 10,
    x=null,
    y=null,
    black = new GrayColor(),
    white = new GrayColor()
    ;


    black.gray = 100;
    white.gray = 0;


activeDocument.layers[0].locked= false;
var newGroup = doc.groupItems.add();
newGroup.name = "NewGroup";
newGroup.move( doc, ElementPlacement.PLACEATBEGINNING );


for(var c=0,len=swatches.length;c<len;c++)
{
        var swatchGroup = doc.groupItems.add();
        swatchGroup.name = swatches[c].name;
       
        x= (w+h_pad)*(c% cols);
        y=(h+v_pad)*(Math.floor((c+.01)/cols))*-1 ;
        rectRef = doc.pathItems.rectangle(y,x, w,h);
        rgbColor = swatches[c].color;
        rectRef.fillColor = rgbColor;
        textRectRef =  doc.pathItems.rectangle(y- t_v_pad,x+ t_h_pad, w-(2*t_h_pad),h-(2*t_v_pad));
        textRef = doc.textFrames.areaText(textRectRef);
        textRef.contents = swatches[c].name+ "\r" + getColorValues(swatches[c].color) ;
        textRef.textRange.fillColor = is_dark(swatches[c].color)? white : black;
        //
        rectRef.move( swatchGroup, ElementPlacement.PLACEATBEGINNING );     
        textRef.move( swatchGroup, ElementPlacement.PLACEATBEGINNING );
        swatchGroup.move( newGroup, ElementPlacement.PLACEATEND );
}


function getColorValues(color)
{
        if(color.typename)
        {
            switch(color.typename)
            {
                case "CMYKColor":
                    if(displayAs == "CMYKColor"){
                        return ([Math.floor(color.cyan),Math.floor(color.magenta),Math.floor(color.yellow),Math.floor(color.black)]);}
                    else
                    {
                        color.typename="RGBColor";
                        return  [Math.floor(color.red),Math.floor(color.green),Math.floor(color.blue)] ;
                       
                    }
                case "RGBColor":
                   
                   if(displayAs == "CMYKColor"){
                        return rgb2cmyk(Math.floor(color.red),Math.floor(color.green),Math.floor(color.blue));
                   }else
                    {
                        return  [Math.floor(color.red),Math.floor(color.green),Math.floor(color.blue)] ;
                    }
                case "GrayColor":
                    if(displayAs == "CMYKColor"){
                        return rgb2cmyk(Math.floor(color.gray),Math.floor(color.gray),Math.floor(color.gray));
                    }else{
                        return [Math.floor(color.gray),Math.floor(color.gray),Math.floor(color.gray)];
                    }
                case "SpotColor":
                    return getColorValues(color.spot.color);
            }    
        }
    return "Non Standard Color Type";
}
function rgb2cmyk (r,g,b) {
 var computedC = 0;
 var computedM = 0;
 var computedY = 0;
 var computedK = 0;


 //remove spaces from input RGB values, convert to int
 var r = parseInt( (''+r).replace(/\s/g,''),10 ); 
 var g = parseInt( (''+g).replace(/\s/g,''),10 ); 
 var b = parseInt( (''+b).replace(/\s/g,''),10 ); 


 if ( r==null || g==null || b==null ||
     isNaN(r) || isNaN(g)|| isNaN(b) )
 {
   alert ('Please enter numeric RGB values!');
   return;
 }
 if (r<0 || g<0 || b<0 || r>255 || g>255 || b>255) {
   alert ('RGB values must be in the range 0 to 255.');
   return;
 }


 // BLACK
 if (r==0 && g==0 && b==0) {
  computedK = 1;
  return [0,0,0,1];
 }


 computedC = 1 - (r/255);
 computedM = 1 - (g/255);
 computedY = 1 - (b/255);


 var minCMY = Math.min(computedC,
              Math.min(computedM,computedY));
 computedC = (computedC - minCMY) / (1 - minCMY) ;
 computedM = (computedM - minCMY) / (1 - minCMY) ;
 computedY = (computedY - minCMY) / (1 - minCMY) ;
 computedK = minCMY;


 return [Math.floor(computedC*100),Math.floor(computedM*100),Math.floor(computedY*100),Math.floor(computedK*100)];
}


function is_dark(color){
       if(color.typename)
        {
            switch(color.typename)
            {
                case "CMYKColor":
                    return (color.black>50 || (color.cyan>50 &&  color.magenta>50)) ? true : false;
                case "RGBColor":
                    return (color.red<100  && color.green<100 ) ? true : false;
                case "GrayColor":
                    return color.gray > 50 ? true : false;
                case "SpotColor":
                    return is_dark(color.spot.color);
                
                return false;
            }
        }
}

arop16461101,

something like that?

var theLayers = app.activeDocument.layers;
var str = new Array ();
for (i = 0; i < theLayers.length; i++) {
    str.push (theLayers[i].name)
    }
var tF = theLayers[0].textFrames.add();
tF.contents = str.join ("\r");
alert("new text frame with layerlist added on layer " + theLayers[0].name);

Have fun

Tags: Illustrator

Similar Questions

  • Script to rename the virtual computer by name DNS listed in VC

    I am very new to powershell, and I tried to understand this by using pieces of code I found, but nothing helped.

    I'm looking for a script to take the given DNS host name for a virtual machine listed in VCenter and rename the virtual computer.

    For example.

    Host01VM01 (as shown in Vcenter) - the DNS name of the "something.xyz.com".   VM and rename it "something.xyz.com" in Vcenter.

    To run the script only for a group called "Mycluster" you can do:

    Get-Cluster "My Cluster" | Get-VM | `
    Where-Object { $_.Guest.HostName } | `
    ForEach-Object { Set-VM -VM $_ -Name $_.Guest.HostName -Confirm:$false }
    

    This script will only work for VMS that have installed VMware tools and probably only for VM which are turned on.

  • Palm m100 error: could not open to make the list of database

    I have an old Palm m100 and never even use your handheld more.  I have the software on my windows XP desktop.  The program worked very well and the other day, I tried to open it and received an error message "Unable to open to make the list of database."

    I did save about 30 days ago, but have since been several dates in the calendar.  I don't really care "do" list, but still failed to open the program.

    I thought to uninstall and then reinstall.  When I go into Add/Remove Programs, I don't see the program of palm - where could I find it?  I also tried to restore to an earlier date of a few days, but that has not worked.  Any other ideas?

    If 'do' database does not open, you can try the following to see if you can open the program.

    Go to program files on drive c. find the Palm folder. In the Palm folder, find your username folder, it will be a similar name to your hotsync username. In the user name folder, find the folder tasks/todo.

    Right-click and rename the folder, set a .old on the file extension. Try and open Palm desktop.

    Palm desktop must be in the Add/Remove Programs list in the control panel and should be included as a Palm or Palmone.

    Click on the following link for the guide of the user for your handheld.

    User Guide (PDF: 2.4 MB / 212 pages)

    The best way to protect your data is to export the data in each category of Palm Desktop in a separate folder on your PC.

    Create a new folder on your PC somewhere that suits. Name it something like Palm Desktop data. Click on the link below and follow the instructions on this page for the export procedure.

    http://www.Palm.com/cgi-bin/cso_kbURL.cgi?id=28734

    Make sure you only select everything for the beach in the export window.

    With the data stored in the created folder, make a copy of this file and save it on a USB key, cd - rw or external hard drive.

    Whenever you change in Palm Desktop, export the data that has been changed in this file and save again to external media.

    With this process you can always import the data in Palm Desktop, whenever you have a problem with the data in Palm Desktop, or if your computer/hard drive/device crash.

  • The module "Adobe layer Namer" does not appear in the extensions.

    Hi all.

    I use PS cc 2015.

    Well the module "Adobe layer Namer" appear to have correctly installed and appears on my Adobe add-on page, it does not appear under window > Extensions.

    Please notify.

    Thank you

    Dario.

    Did you try to remove and reinstall add on?

    Please disconnect from creative cloud app and then reconnect.

    Concerning

    Jitendra

  • Flash game - is there a way to make the function of stage names?

    I have a game where you are conditioned to the task to collect various objects on the screen. I did level 1 and everything worked fine. Then, I decided to level 2 in a new file. I completed level 2, and deliver level 2 in the main file, however I had used the same lvel object names 1 and level 2. This has resulted in close to 100 errors due to the high amount of bodies and the functions of the same name. I want to know is that you can use code in the action script to ensure that functions and instances are specific locations. For example, to make sure I can use the function 'checkCollision' in the stage 1 and stage 2. Thanks for your time.

    lol you can use the duplicate on the same timeline function names.

    If the functions with the same names are the same, you can simply remove these functions from your 2nd stage.

    or, you can rename these functions.  This can be done using stage names to concatenate with another string and can be automated with jsfl.

  • How to fix: after upgrade to 31.1, using the list of group name does not, gives the messages this name "is not a valid email address."

    Before the upgrade, I often type in the group alias in the address box, and fills the name of the group. But now when I try to send the message, I get an error that the name that appears "is not a valid email address" and then details how to train the appropriate addresses.

    I deleted the list of my address book personal and recreated to address in my CAP, but the error persists. I have to manually add individual addresses.

    I tried selecting the group from the list in the Contacts pane instead of typing the alias, no change.

    I'm doing something wrong?

    -Mike

    I have new information on this subject.

    It looks like this bug. If you have a Bugzilla account, it would be useful to vote for this issue.

    It seems that lists with a description that includes several words have this problem. The bug report suggests to replace whites "" between the words in the descriptions of these lists with an underscore "_".

    If you don't want to change your descriptions, the other workaround provided still works.

  • Copy the InDesign UI of Script text into the list item

    Hello world

    I wrote a script code user interface to create a terminology database.

    I want to be able to click on an item in the list of all the columns and copy the text in edittext field.

    I don't know if I need to create a button for this or is - it possible to do a right-click of the mouse to copy text?

    Here is the code:

    var w = new window (' dialog {text: 'Blatchford termbase', alignChildren: 'fill'} "");
    w.Spacing = 0;

    var headers = w.add ('group');
    headers. Spacing = 0;
    headers. Margins = [0,5,0,0];
    dimH var = [0,0,200,20];

    headers. Add ("statictext', dimH, '\u00A0English'");
    headers. Add ("statictext', dimH, '\u00A0French'");
    headers. Add ("statictext', dimH, '\u00A0German'");
    headers. Add ("statictext', dimH, '\u00A0Italien'");
    headers. Add ("statictext', dimH, '\u00A0Spanish'");
    headers. Add ("statictext', dimH, '\u00A0Norwegian'");
    headers. Add ("statictext', dimH, '\u00A0Russian'");
    headers. Add ("statictext', dimH, '\u00A0Turkish'");

    headers.graphics.backgroundColor = w.graphics.newBrush (w.graphics.BrushType.SOLID_COLOR, [0.7,0.7,0.7],1);

    for (var i = 0; i < headers.children.length; i ++)

    headers. Children [i]. Graphics.font = scriptui.newFont ('Myriad Pro', 'fat', 16)

    var column = w.add('group{multiselect:true}');
    Columns.Spacing = 0;

    CGEM var = [0,0,200,600];

    var col1 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col2 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col3 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col4 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col5 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col6 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    col7 var = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col8 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);

    var user_input = w.add ('group')
    entry var = user_input.add ('edittext', dimH, ");
    entry. Characters = 30;
    entry. Alignment = 'left';
    entry.active = true;

    col1. Selection = 0;

    converting the vars = user_input.add ('button', undefined, "Convert to lowercase");
    convert.onClick = function () {entry.text = entry.text.toLowerCase () ;}
    user_input.orientation = 'row';
    user_input. Alignment = 'left';

    w.Show ();

    Any help or comments would be greatly appreciated

    Try this

    col1.onChange =
     col2.onChange =
     col3.onChange =
     col4.onChange =
     col5.onChange =
     col6.onChange =
     col7.onChange =
     col8.onChange =
     function() {
      entry.text = this.selection? this.selection.text : "";
      }
    

    Loïc

    Ozalto | Productivity-oriented - Loïc Aigon

  • UNIX command to the list of file name

    Hi gurus,

    I saw post how to process several files of johngoodwin.blogspot.com.
    But what is the command to equlivalent on unix to list all file names.

    I want a text file will contain all the text file name and another text file will contain all the names of csv files.

    Need a suggestion. Help, please.

    Thanks in advance.

    On UNIX, you can use the ls command to find the contents of a directory and then you can send this output and crerate a file out of it.

    ls *.csv > list_of_csv_files.txt

    ls *.txt > list_of_text_files.txt

    You need to run it from the directory you are trying to find the content.

  • How to make the list of instrumental music

    How to make a list of all my player someone help

    Alan

    iTunes is not a method to determine what tracks have vocals. You can create a normal playlist and put what you want in it.

    TT2

  • How to make 'the list' by default for Windows Explorer?

    Details is the option by default whenever I find files or documents in Windows Explorer in Windows 7.  I can change a particular folder for the 'list', but as having the default value for the list and details to be an option.

    If you set this value, it will remember that whenever you return to this file until you change something else.  If you don't want to define for each folder one at a time, you can use my trick to apply both:

  • The list of all names of virtual machines that are attached to the computer with script group

    I need a script that would list all the virtual machines names that are attached to the Machine group as the bellows screenshot:

    vcm.jpg


    Ce can be in any language I just need to get this information.

    I tried to Watch in database and found vm names of in table [ecm_dat_machines] and Group of/ids in names of table [ecm_sysdat_machine_groups] but I don't find table that would be assign vm to the Group.

    I serait appreciate any help or clue as I already spent a lot of time on this task.

    Attached file of import/export includes a view created for the SQL below, as well as a SQL report that uses this perspective to the computers by group in the VCM UI.

    Note that the functions used in the join of the query criteria are there to ensure that only valid/active/license machines are displayed, these date data and time are adjusted to the time zone of the user, and that the users do not see that their role does not have access to groups of computers.

    SELECT

    m.machine_name,

    mg.machine_group_name,

    mg.machine_group_desc,

    DATEADD (mi, utc.utc_offset, m.date_last_contact) as date_last_contact

    OF dbo.ecm_dat_machine_group_machines_xref mgx

    JOIN dbo.ecm_dat_machines m

    ON mgx.machine_id = m.machine_id

    Join dbo.ecm_dat_machine_groups mg

    ON mgx.machine_group_id = mg.machine_group_id

    JOIN dbo.ecm_dat_roles_machine_group_xref rmx

    ON mgx.machine_group_id = rmx.machine_group_id

    AND rmx.role_id = dbo.role_current)

    JOIN dbo.ecm_fn_machines_valid_t (vm)

    ON mgx.machine_id = vm.machine_id

    JOIN dbo.ecm_user_utc_offset (utc)

    1 = 1

  • Script to make the button stay on State hit until the other is clicked!

    Hello

    Got a little problem that I can't solve.

    I have a line of 5 buttons including each links to a different page. These buttons are currently in a clip.

    However, I would like to create an effect where when a user clicks on it remains highlighted. that is still on the State of success, until the user clicks one of the buttons.

    I would have thought it would be somethink that I could find online, but carnt seem to find anywhere.

    I found the code to make a point to stay on when you click on it, but it works on its own in the entire movie clip, so it has no effect when you click on other buttons on!

    Have tried the script below, but I'm sure that this will not work because it is not a link to the other buttons at all.

    on {(press)

    if (this ._currentframe == 1) {}
    this.gotoAndStop (2);
    { } else {}
    this.gotoAndStop (1);
    }
    }
    Thanks for any help!

    You are welcome.  Here is a slightly condensed version of the same thing...

    var lastBtnUsed;

    Btn1.onRelease = btn2.onRelease = btn3.onRelease = btn4.onRelease = function() {}
    processBtns (this);
    }

    function processBtns (newBtn) {}
    If (lastBtnUsed! = null & lastBtnUsed! = newBtn) {}
    lastBtnUsed.gotoAndStop (1);
    }
    lastBtnUsed = newBtn;
    newBtn.gotoAndStop (2);
    }

  • Windows Explorer crashes when you try to make the list of associated file types. Error: 0xc0000005

    This is the view in the general tab of the event viewer. Looks like a problem ole32.dll but I don't know what to do. I have Win 7.

    The failing application name: Explorer.EXE, version: 6.1.7600.16450, time stamp: 0x4aeba271

    The failed module name: ole32.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdac7

    Exception code: 0xc0000005

    Offset: 0x0002af88

    ID of the process failed: 0x1bfc

    Start time of application vulnerabilities: 0x01cafc16e3fb0780

    The failing application path: C:\Windows\Explorer.EXE

    The failed module path: C:\Windows\system32\ole32.dll

    Report ID: 605a0c40-680a-11df-b86a-001e90f0c8af

    Thank you

    Brian

    Often, a certain instability in Windows Explorer is due to the defective shell extensions and addons.
    Consider using Sysinternals Autoruns or ShellExView. Disable Add-ons and non Microsoft shell extensions and verify the behavior.  If he went, reactivate the disabled extensions/add-ons, one at a time and see if you can identify who may be liable.
    Try a clean boot, or boot into safe mode.  The behavior persists?
    If you continue to experience the problem, consider creating the hierarchy of following registry keys in the registry:
    HKLM\Software\Microsoft\Windows\Windows error Reporting\LocalDumps\explorer.exe\
    In the explorer.exe key, create a REG_EXPAND_SZ value named DumpFolder and set the value to%systemdrive%\localdumpsdata.  Ensure that the %systemdrive%\localdumps file exists, and then cause the crash to happen.  It must be a dump file in %systemdrive%\localdumps. Download the dump on your SkyDrivefile.
    (Letter is an environment variable that represents the system drive, usually C:.)
  • RH11. Script to make the Next and Prev buttons to work as they do in a standard browser?

    Hello.

    I know the arrows to next and previous button in the navigation pane to take the user to the next or previous section specified in the sequence of browser. This means that the help author has design one or more sequences of navigation, which can be long and difficult to maintain.

    Someone at - he created a script, or know if there is, who can transform the Next and Prev buttons buttons that perform standard browser actions. For example:

    • The user opens the A section.
    • The user opens the topic J.
    • User presses the back button.
    • Help opens the A section.

    At the moment the results depend on the navigation sequence.

    • The user opens the A section.
    • The user opens the topic J.
    • User presses the back button.
    • Help opens the topic I have (the subject which precedes the subject J in the sequence to browse).

    Thank you. [

    Carol Levine

    Hi Carol

    I guess you overlooked this link on the page:

    Here is the link should be clicked: (this way you will not have to return to the page)

    Click here to see

    See you soon... Rick

  • IDOC script to get the list of users in alias

    Hello

    In the workflow script, I want to check if dDocAuthor exists in some alias. If there is, then proceed to treatment.

    I'm not able to compare dDocAuthor with users in alias. Infact I couldn't find any function of the IDOC script which returns users to alias.

    Help, please.

    Thank you

    Check out my blog post on how to get around the workflow via idoc if the author is part of a specific alias ():

Maybe you are looking for

  • Biometric Coprozessor need driver for Satego X 200?

    What driver is needed for this biometric thing? Computer laptop satego x 200 - 21 d I ve looking for hours...:(

  • problem installing with C4480 and Time Capsule

    I'm putting in place a new Photosmart C4480 to use with my computer laptop MacBook and my Office PowerPC G4 tower. When I connect the printer directly to the G4 using the USB cable, it works fine. But when I connect to the USB port of my time Capusul

  • LabSQL to MySQL connection string syntax

    Hi all I'm just starting using labSQL and MySQL and cannot even connect to the database, I want to start practicing. I tried to write my own code and use the code example, but I can't get a connection to a database. The error is still "an Exception o

  • LabVIEW does not allow me to add SBRIO project, but SBRIO appears in MAX

    Hi, I have my SBRIO appears in MAX, but I can't create a project in LabVIEW 2009 which has the SBRIO as target. I would like a program for the SBRIO FPGA VI. Sorry for any inconvience caused by the huge images. Three different screenshots into one im

  • connect to tv

    I want to know what it is I need to see Amazon Prime on my big screen tv. My PC is a Pavilion TS 15 with Windows 8. My TV is a LG 55LH90 with no internet connection. I've been using a WII see Amazon Prime via television, but it is poor just an HDMI c