Script for adding layer name to artboard as text

I've found scripts that are sort of close but not quite this.
I have 1 artboard and many layers (see image).
Does anyone have a script that will take the name of the layer, ie "01_Intro" and create and then place the text "01_Intro" on to the art board in layer 01_Intro? Then it would repeat the process for all the present layers?
Thanks in advance!

Waterbear,
something like this?
// LayersnamesInUpperLeftCorner.jsx
// https://forums.adobe.com/thread/1546630
// write layers names in upper left corner of the active artboard
// required: opened document, no toplevel layers locked, all layers visible
// regards pixxxelschubser
var aDoc = app.activeDocument;
var theLayers = aDoc.layers;
for (i=0; i<theLayers.length; i++) {
    var txt = theLayers[i].textFrames.add();
    txt.position = [0,0];
    txt.contents = theLayers[i].name;
Have fun

Similar Messages

  • Script for using layer name in Save for Web command

    I am using the Save for Web  command (Illustrator CS2) to export layers to CSS so that each layer is  saved as a different jpg.  The only issue I have is that I want the  layer name to be part of the file name, but layer name is not an option  when I look at the "Edit Output settings" dialog for saving files.  Is  there anyway I can do this? I do not have experience writing or working with scripts.
    For example. My fiel name is flower.ai.  I will have 20  different layers (each containing a different color of the same image)  and want the exported file to be flower-scarlet.jpg,  flower-cranberry,jpg, etc. Right now I am looking at renaming all the  files manually, but as I am creating 40 images per product on my website, this will be very time consuming.
    Thanks in advance
    Christine

    Btw.. to make it work for JPGs, change the PNG options to the following:
    var options = new ExportOptionsJPEG();
            options.antiAliasing = false;
            options.optimization = false;
            options.artBoardClipping = true;
            options.qualitySetting = 100; // value of 0 to 100, 60 is medium, 100 is perfect
            options.blurAmount = 0;
            options.verticalScale = 100;
            options.horizontalScale = 100;

  • Is there a script for changing layer names in ID CS4?

    I have multiple documents with an average of 20 layers in each. Each of the layers is named for the expiration date of the coupon in the ads. When a new order comes in I retrieve the previous files and change the dates via scripts and the Find/Change option. I have looked but cannot find a way to rename the dates in the layers as well.
    Does anyone know of a script for this?
    Thanks in advance!

    E-mail, eh? You're missing out a lot of fun stuff, as there is
    - editing your own posts
    - using bold and italics to highlight important stuff
    - finally being able to shout (some posters think it's necessary to use a large bold font to make their post stand out in the crowd. They are correct, it does. In the Bad way.)
    - inserting images
    - uh, Jive (-- sorry, couldn't think of any more fun stuff to add)
    Visit the scripting forum (using a web browser, s'il vous plait) by clicking here.

  • Scripts for adding/deleting/modifying Open Directory accounts?

    I think I have searched high and low for an answer to this question, but if I missed it please point me in the right direction. Where can I find information on scripts for adding/deleting/modifying open directory accounts? At the very least, a command line utility with some syntax guidelines! Any help would be greatly appreciated.

    Hi
    I personally don't know if any scripts although you can use the command line to do pretty much anything you want with the Open Directory. Consult the manual: man dscl. If you launch terminal and issue dscl you should see something like this:
    my-Laptop:~ me$ dscl
    dscl (v20.4)
    usage: dscl [options] [<datasource> [<command>]]
    datasource:
    localhost (default) or
    <hostname> (requires DS proxy support, >= DS-158) or
    <nodename> (Directory Service style node name) or
    <domainname> (NetInfo style domain name)
    options:
    -u <user> authenticate as user (required when using DS Proxy)
    -P <password> authentication password
    -p prompt for password
    -raw don't strip off prefix from DS constants
    -url print record attribute values in URL-style encoding
    -q quiet - no interactive prompt
    commands:
    -read <path> [<key>...]
    -create <record path> [<key> [<val>...]]
    -delete <path> [<key> [<val>...]]
    -list <path> [<key>]
    -append <record path> <key> <val>...
    -merge <record path> <key> <val>...
    -change <record path> <key> <old value> <new value>
    -changei <record path> <key> <value index> <new value>
    -search <path> <key> <val>
    -auth [<user> [<password>]]
    -authonly [<user> [<password>]]
    -passwd <user path> [<new password> | <old password> <new password>]
    Entering interactive mode...
    The above is for 10.4 and should server equally as well for 10.5.
    Hope this helps, Tony

  • Script for adding a login item for all accounts in the system

    Hi,
    Thanks for reading this query. I am new to the mac environment. I have developed a java application and created an installer of this application for MAC system.I want to run this application on starting the system. So I have written an apple script for adding this application in login items and this script will run immediately after completing installation process. And the entire process is fine. But the problem is, the application is added to login items of only the user who installed the application. But I want to get available the application in the login list of all accounts created in the system. How can I achieve this? Once more thanks in advance. I am attaching my script below:
    +*tell application "System Events"*+
    +* make login item at end with properties {path:"/Applications/MyApplication.app", hidden:true}*+
    +*end tell*+

    Hi,
    Try to use tables RSOSFIELDMAP, RSDSSEGFD and RSTRAN
    Hope it helps
    bhaskar

  • A script for adding the current date to file name?

    I am working in Indesign CS3. I frequently save file as PDFs into a designated folder. I was hoping for help in writing a script that would apply the current date to the end of the file name, when saved into this folder. Some days, I save the same file several times, into this folder. I was also hoping there was a way to add a date and version, for example "filename_2.25.11(1).pdf" Is this possible? Can someone help me?

    ok, I ended up with this test routine:
    on adding folder items to this_folder after receiving added_items
    tell application "Finder"
    repeat with this in added_items
    my checkifopened(this)
    display dialog (name of this) as text
    end repeat
    end tell
    end adding folder items to
    on checkifopened(this)
    set a to POSIX path of (this as alias)
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    exit repeat
    else
    say "still opened"
    end if
    end repeat
    end checkifopened
    this is a folder action that tests if the added file is still opened by an application... there is no delay between each test-loop since lsof takes some time to execute...
    And after adding a timeout (just in case) to this function the final script looks like this:
    on adding folder items to thefolder after receiving added_items
    tell application "Finder"
    set folderkind to kind of thefolder
    set myfiles to every item of thefolder whose name does not contain "#" and kind is not folderkind
    repeat with myfile in myfiles
    set myfile_datestring to my get_datestring(creation date of myfile)
    set myfilename to name of myfile
    if (count of every character of myfilename) > 4 and (character -4 of myfilename) as text is "." then
    set filestatus to my checkifopened(myfile, 60)
    if filestatus = false then
    display dialog "timeout on folder action"
    else
    set tmp to ((characters 1 through -5 of myfilename) & "#" & myfile_datestring & (characters -4 through -1 of myfilename)) as text
    set myfilename to my checknamewith_pdfsuffix(tmp, thefolder, false)
    set name of myfile to myfilename
    end if
    end if
    end repeat
    end tell
    end adding folder items to
    on get_datestring(mydate)
    return year of mydate & "-" & (characters -2 through -1 of (("0" & (month of mydate as integer)) as text)) & "-" & (characters -2 through -1 of (("0" & (day of mydate as integer)) as text)) as text
    end get_datestring
    on checknamewith_pdfsuffix(n, D, looped)
    --check if filename exists in D
    -- so if "A File.pdf" exists it names it "A File 1.pdf","A File 2.pdf",...
    #n = string of the filename
    #D = file reference to the directory to check
    #looped = boolean used for recursive loop...
    tell application "Finder"
    set thefiles to name of every item of (D as alias)
    end tell
    if thefiles contains n then
    if looped = false then
    set n to ((characters 1 through -5 of n) & "(1)" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    else
    set tmp to (last word of ((characters 1 through -5 of n) as text) as integer)
    set tmpcount to (count of characters of (tmp as text)) + 5
    set tmp to tmp + 1
    set n to ((characters 1 through (-1 * tmpcount) of n) & "(" & tmp & ")" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    end if
    else
    return n
    end if
    end checknamewith_pdfsuffix
    on checkifopened(this, mytimeout)
    ## this file reference
    ## timeout in seconds
    set a to POSIX path of (this as alias)
    set startdate to current date
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    return true
    else if ((current date) - startdate) > mytimeout then
    return false
    else
    ##say "still opened"
    end if
    end repeat
    end checkifopened
    to use this save this script in /Library/Scripts/Folder Action Scripts
    and add this as a folder action to your folder...
    The script processes all files inside that folder each time a new files is added...

  • Script to change layer name in to Document name.

    Hi I would like to make the active layer name the same as the document name.  I know very little about scripting.  I found this script:
    var idoc = app.activeDocument;
    var ilayer = idoc.activeLayer;
    var filename = idoc.name;
    ilayer.name = filename;
    It does almost what I need it to do. except that it also copies the ".ai" in to the layer name.  Is there some way to modify this script to have it exclude or delete the file extension?
    Thanks for any help.

    Or, if you want to keep the same construction as your example...
    var idoc = app.activeDocument;
    var ilayer = idoc.activeLayer;
    var filename = idoc.name;
    filename = filename.slice (0, filename.lastIndexOf(".")); //just add this line to the construction.
    ilayer.name = filename;
    Gustavo.

  • Script for adding datafile to tablespace

    Hi
    Does anyone have a template alter tablespace add datafile script handy?
    Basically, we need to, in the event of a tablespace alert, do two things:
    query that tablespace to see how much space is remaining.
    ascertain the size of the datafiles added to that tablespace already (to clarify what size we should make the additional datafile)
    finally, the command itself for adding the extra datafile.
    Thanks.
    10.0.2.0

    SELECT Total.tablespace_name "TSPACE_NAME",
    round(nvl(TOTAL_SPACE,0),2) Tot_space,
    round(nvl(USED_Space,0),2) Used_space,
    round(nvl(TOTAL_SPACE - USED_Space,0),2) Free_space,
    round(nvl(round(nvl((TOTAL_SPACE - USED_Space)*100,0),2)/(Total_space),0),2) "USED%"
    FROM
    (select tablespace_name, sum(bytes/1024/1024) TOTAL_SPACE
    from sys.dba_data_files
    group by tablespace_name
    ) Total,
    (select tablespace_name, sum(bytes/1024/1024) USED_Space
    from sys.dba_segments
    group by tablespace_name
    ) USED
    WHERE Total.Tablespace_name(+) = USED.tablespace_name and
    round(nvl(round(nvl((TOTAL_SPACE - USED_Space)*100,0),2)/(Total_space),0),2)< 20;
    the above query will display tablespaces which are having freespace below 20%
    select file_name,autoextensible,sum(bytes)/1024/1024,sum(maxbytes)/1024/1024
    from dba_data_files
    where tablespace_name='TBS_NAME'
    group by file_name,autoextensible;
    the above query will give details of datafiles like autoextensible or not etc.
    SELECT SUBSTR (df.NAME, 1, 40) file_name,dfs.tablespace_name, df.bytes / 1024 / 1024 allocated_mb,
    ((df.bytes / 1024 / 1024) - NVL (SUM (dfs.bytes) / 1024 / 1024, 0))
    used_mb,
    NVL (SUM (dfs.bytes) / 1024 / 1024, 0) free_space_mb
    FROM v$datafile df, dba_free_space dfs
    WHERE df.file# = dfs.file_id(+)
    GROUP BY dfs.file_id, df.NAME, df.file#, df.bytes,dfs.tablespace_name
    ORDER BY file_name;
    the above query will show how much freespace is left in each datafile.

  • Script to search layer names

    Hi -
    Does anyone know if there is a script that can search through layer names within a file for a specific text string and then select it as the active layer?
    For instance, if a file has 4 layers, named My LayerX, LayerY, LayerZ, LayerA, I want to automatically search for a layer that has the text "rA" and make it the active layer.
    Thanks.

    This requires CS4 or better. It searchs using a RegExp and Action Manager so it should be very fast. It is set up now to deal with more than one matching layer.
    var re = /rA/;// a reg exp
    var matches = collectNamesAM(re);// get array of matching layer indexes
    for( var l = 0; l < matches.length; l++ ){
        makeActiveByIndex( l, false );
        // do something with layer
        alert(app.activeDocument.activeLayer.name);
    }// next match if any
    function collectNamesAM(re){
         var allLayers = new Array();
       var startLoop = Number( !hasBackground() );
       var endLoop = getNumberOfLayer();
       for( var l = startLoop;l < endLoop; l++){
            while( !isValidActiveLayer( l ) ) {
                l++;
            if( getLayerNameByIndex( l ).match(re) != null){
                allLayers.push( l );
         return allLayers;
    // Function: getActiveLayerIndex
    // Description: Gets gets the Action Manager API index
    //                        of activeLayer corrected for Background Layer
    // Usage: var idx = getActiveLayerIndex();
    // Input: None
    // Return: Number - correct AM itemIndex
    // Dependices: hasBackground
    function getActiveLayerIndex() {
         var ref = new ActionReference();
         ref.putProperty( 1349677170 , 1232366921 );
         ref.putEnumerated( 1283027488, 1332896878, 1416783732 );
         var res = executeActionGet(ref).getInteger( 1232366921 )
                                                           - Number( hasBackground() );
         res == 4 ? res++:res// why the skip in this doc?
         return res;  
    // Function: isValidActiveLayer( )
    // Description: Checks LayerSection for 'real' layers
    // Usage: if( isValidActiveLayer() )
    // Input: None
    // Return: Boolean - True if not the end of a Set
    // Notes:  Needed only if the layer was made active
    //               using Action Manager API
    function isValidActiveLayer( idx ) {
         var propName = stringIDToTypeID( 'layerSection' );// can't replace
         var ref = new ActionReference();
         ref.putProperty( 1349677170 , propName);// TypeID for "Prpr"
         // 'Lyr ", idx
         ref.putIndex( 1283027488, idx );
         var desc =  executeActionGet( ref );
         var type = desc.getEnumerationValue( propName );
         var res = typeIDToStringID( type );
         return res == 'layerSectionEnd' ? false:true;
    // Function: hasBackground
    // Description: Test for background layer using AM API
    // Usage: if( hasBackground() );
    // Input: None
    // Return: Boolean - true if doc has background layer
    // Notes:  Requires the document to be active
    //  DOM:  App.Document.backgroundLayer
    function hasBackground(){
        var res = undefined;
        try{
            var ref = new ActionReference();
            ref.putProperty( 1349677170 , 1315774496);
            ref.putIndex( 1283027488, 0 );
            executeActionGet(ref).getString(1315774496 );;
            res = true;
        }catch(e){ res = false}
        return res;
    function makeActiveByIndex( idx, forceVisible ){
         try{
              var desc = new ActionDescriptor();
              var ref = new ActionReference();
              ref.putIndex(charIDToTypeID( "Lyr " ), idx)
              desc.putReference( charIDToTypeID( "null" ), ref );
              desc.putBoolean( charIDToTypeID( "MkVs" ), forceVisible );
              executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
         }catch(e){ return -1;}
    function getNumberOfLayer(){
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var desc = executeActionGet(ref);
    var numberOfLayer = desc.getInteger(charIDToTypeID("NmbL"));
    return numberOfLayer;
    function getLayerNameByIndex( idx ) {
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "Nm  " ));
        ref.putIndex( charIDToTypeID( "Lyr " ), idx );
        return executeActionGet(ref).getString(charIDToTypeID( "Nm  " ));;

  • Best / most popular software or scripts for adding search function to website?

    I'm trying to find a good piece of software or script for implementing a site search function into our website.  I am relatively knowledgeable in Dreamweaver and can write CSS and XHTML at the fairly intermediate to advanced level, as well as work with JavaScript and js files, but I don't really know much ASP or "by hand" Java coding.  Their are so many scripts and software out there for adding a site search that it's hard to sort through and narrow down.  I was hoping to find reviews of the popular ones or "top 10 lists" of some sort that would help me pinpoint a good one, but can't find anything like that.  These are the primary needs of the website:
    --Has under 50 searchable pages that won't change much and probably won't exceed 50. There are product part numbers and descriptions for some 250-300 part numbers, spread across only 24 of those pages.  The remaining pages are important but no part numbers-- About Us, News, Where to Buy, History, Featured Products, etc.  The product pages are very much like an online store but we don't sell directly on the site (only thru distributors/reps).
    --We are trying to keep the price under about $50, or use a free solution
    --The pages are all static XHTML+CSS pages, but our server can run ASP (we have another website for one of our other product line divisions, on the same server, with many more products beyond 1000, which was programmed completely in ASP by an outside company about 4 years ago).  We self-host both sites.
    --Our server can't run PHP
    --The search capabilities need only be rather basic-- a keyword search with a results page that uses the same design template as the rest of the site.  It would be nice, but not mandatory, to have a search filter and/or a drop down menu to enable selectively searching only certain parts of the site, or only product/part number search vs. general search, etc. (but again, not mandatory).
    --I do have a sitemap page already on it, if that matters or helps
    Some of the ones I've found so far that looked the most promising include:  Zoom Search Engine (http://www.wrensoft.com/zoom/), Site Search Pro (http://www.site-search-pro.com/), and FX Site Search which is a DW Extension I found in the exchange (http://www.felixone.it/extensions/prod/mxssen.asp)-- (that one looks possibly technically challenging or requiring more ASP skill, though)
    Forgive me if there is a better area to post this, if so let me know.

    For a static site, your options are:
    Google ~  http://www.google.com/sitesearch/
    Freefind ~ http://www.freefind.com/
    Zoom from Wrensoft ~ http://www.wrensoft.com/zoom/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • Required alter script for adding partition and subpartition

    Hi Folks,
    Please help me to write ALTER STATEMENT for adding new partition P1 and SUBPARTITION P1_201001 and P1_201002.
    Thank you
    TABLE
    =======
    CREATE TABLE TEST
         "REPORT_ID"    NUMBER,
        "MONTH_ID"      NUMBER,
        "GROUP_ID"      NUMBER,
        "AGE_GROUP_ID"  NUMBER,
        "GENDER_CD"     CHAR(1 BYTE),
    PCTFREE 0 PCTUSED 0 INITRANS 1 MAXTRANS 255 COMPRESS BASIC NOLOGGING STORAGE
        BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
      TABLESPACE "USER_WORK" PARTITION BY RANGE
        "REPORT_ID"
      SUBPARTITION BY LIST
        "MONTH_ID"
      SUBPARTITION TEMPLATE
        SUBPARTITION "M201212" VALUES
          201212
        TABLESPACE "USER_WORK"
    (PARTITION "P3" VALUES LESS THAN (4) PCTFREE 0 PCTUSED 0 INITRANS 1 MAXTRANS 255 STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USER_WORK" COMPRESS BASIC NOLOGGING ( SUBPARTITION "P3_M201212" VALUES
          201212
        TABLESPACE "USER_WORK" COMPRESS BASIC, SUBPARTITION "P3_M201301" VALUES
          201301
        TABLESPACE "USER_WORK" COMPRESS BASIC )
    );

    First modify the subpartition template
    ALTER TABLE TEST set
      SUBPARTITION TEMPLATE
        SUBPARTITION "M201212" VALUES
          201212
        SUBPARTITION P1_201001 VALUES (201001),
        SUBPARTITION P1_201002 VALUES (201002)
      )Then if the new partition is HIGHER than ALL existing ranges you can just add it
    alter table test add
    PARTITION "P1" VALUES LESS THAN (5) If the new partition is LOWER than one onf the existing ranges you will need to SPLIT the existing partition.
    alter table test SPLIT PARTITION "P3" AT (2)
    INTO (PARTITION P1, PARTITION P3)See the sections in the VLDB and Partitioning Guide
    Modifying a Subpartition Template
    http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1007904
    Splitting a Partition of a Range-Partitioned Table
    http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1008028

  • Bold option, at least for main layer names

    I realize it may not be simple, but it would be so helpful in complex docs with many layers and sublayers to have the option of putting some in bold, especially the top/main layers. I have over 250 layers in a complex map doc, all sorted in sublayers with styles, etc., but when I open a layer (even with a 30" screen) it becomes a challenge to find my place. A simple bold main layer would really help.

    I can agree with this. I will add to this the suggestion to color entire layer names rather than just the tiny colored area we get now.

  • Script for making an object the artboard size.

    I am looking for some help on trying to make an object the exact size of the artboard.  This is something I do on a daily basis for several different reasons and it would be very helpful if this can happen automatically for whatever size the artboard may be.  As I understand it the only way is with a script but I have no experience with making illustrator scripts, im definately no programmer.  I have set up quickkeys in the past to copy from the artboard inputs when you are on the artboard tool but these round to the nearest .01 and this is not accurate enough for what I am working with.  Also if I do this with multiple pages open illustrator is very slow to respond to the artboard tool.  If anyone has any idea where to start or has seen other such scripts I would greatly appreciate it.  Thank you.
    Below is a script that I saw on here that I believe may contain what I need but now knowing programming I have no idea where to start on editing.  All I need is the part where an object is placed on the artboard that is the exact same size as the artboard.  If anyone can advise on editing I would greatly apprecaite it.
    #target illustrator
    function main() {
         if (app.documents.length == 0) {
              alert('Open a document before running this script');
              return; // Stop script here no doc open…
         } else {
              var docRef = app.activeDocument;
              with (docRef) {
                   if (selection.length == 0) {
                        alert('No items are selected…');
                        return; // Stop script here with no selection…
                   if (selection.length > 1) {
                        alert('Too many items are selected…');
                        return; // Stop script here with selection Array…
                   } else {                   
                        var selVB = selection[0].visibleBounds;
                        var rectTop = selVB[1] + 36;
                        var rectLeft = selVB[0] - 36;
                        var rectWidth = (selVB[2] - selVB[0]) + 72;
                        var rectHeight = (selVB[1] - selVB[3]) + 72;              
                        selection[0].parent.name = 'CC';
                        selection[0].filled = false;
                        selection[0].stroked = true;
                        var ccColor = cmykColor(0, 100, 0, 0);              
                        var ccCol = spots.add()
                        ccCol.name = 'CC';
                        ccCol.color = ccColor;
                        ccCol.tint = 100;
                        ccCol.colorType = ColorModel.SPOT;
                        var cc = new SpotColor();
                        cc.spot = ccCol;                   
                        selection[0].strokeColor = cc;
                        selection[0].strokeWidth = 1;                   
                        var tcLayer = layers.add();
                        tcLayer.name = 'TC';
                        var padBox = pathItems.rectangle(rectTop, rectLeft, rectWidth, rectHeight, false);
                        padBox.stroked = false;
                        padBox.filled = true;
                        var tcColor = cmykColor(0, 100, 90, 0);         
                        var tcCol = spots.add()
                        tcCol.name = 'TC';
                        tcCol.color = tcColor;
                        tcCol.tint = 100;
                        tcCol.colorType = ColorModel.SPOT;
                        var tc = new SpotColor();
                        tc.spot = tcCol;
                        padBox.fillColor = tc;    
                        padBox.move(docRef, ElementPlacement.PLACEATEND);
                        artboards[0].artboardRect = (padBox.visibleBounds);
                        redraw();
                        rectWidth = (rectWidth-72)/72;
                        rectWidth = roundToDP(rectWidth,1);
                        rectHeight = (rectHeight-72)/72;
                        rectHeight = roundToDP(rectHeight,1);
                        var textString = rectWidth + ' x ' + rectHeight;
                        prompt('Copy Me', textString);
    main();
    function roundToDP(nbr, dP) {
         dpNbr = Math.round(nbr*Math.pow(10,dP))/Math.pow(10,dP);
         return dpNbr;
    function cmykColor(c, m, y, k) {
         var newCMYK = new CMYKColor();
         newCMYK.cyan = c;
         newCMYK.magenta = m;
         newCMYK.yellow = y;
         newCMYK.black = k;
         return newCMYK;

    Thanks to CarlosCanto for the original script, it was very a very helpful starting point to optimize one of our workflows. We customized it a bit to maintain the aspect ratio (just takes the greater of the width / height and scales proportionally to the artboard size), and also center up the object in the middle of the artboard once scaling is complete. I hope it is helpful to someone:
    #target Illustrator
    //  script.name = fitObjectToArtboardBounds.jsx;
    //  script.description = resizes selected object to fit exactly to Active Artboard Bounds;
    //  script.required = select ONE object before running; CS4 & CS5 Only.
    //  script.parent = carlos canto // 01/25/12;
    //  script.elegant = false;
    var idoc = app.activeDocument;
    selec = idoc.selection;
    if (selec.length==1)
            // get document bounds
            var docw = idoc.width;
            var doch = idoc.height;
            var activeAB = idoc.artboards[idoc.artboards.getActiveArtboardIndex()]; // get active AB
            docLeft = activeAB.artboardRect[0];
            docTop = activeAB.artboardRect[1];
            // get selection bounds
            var sel = idoc.selection[0];
            var selVB = sel.visibleBounds;
            var selVw = selVB[2]-selVB[0];
            var selVh = selVB[1]-selVB[3];
            var selGB = sel.geometricBounds;
            var selGw = selGB[2]-selGB[0];
            var selGh = selGB[1]-selGB[3];
            // get the difference between Visible & Geometric Bounds
            var deltaX = selVw-selGw;
            var deltaY = selVh-selGh;
            if (sel.width > sel.height) {
                var newWidth = docw-deltaX;
                var ratio = sel.width / newWidth;
                sel.width = newWidth; // width is Geometric width, so we need to make it smaller...to accomodate the visible portion.
                sel.height = sel.height * ratio;
            } else {
                var newHeight = doch-deltaY;
                var ratio = sel.height / newHeight;
                sel.height = newHeight;
                sel.width = sel.width / ratio;
            sel.top = (doch / 2) - (sel.height / 2);
            sel.left = (docw / 2) - (sel.width / 2);
        else
                alert("select ONE object before running");

  • Need Help with script For Bulk Users Name & Description Updation

    Hi Guys,
    I have below requirement :
    We are having one windows 2008 stand alone server with 200+ local users (No Active Directory Account).
    1. Requirement is to update each account's "Full name" and "Description field" with same text. Which means , Full name and Description field will be same with same text. No other changes are required. )Attached the screenshot)
    Can you guys pls help me out with any scripting (vbs , powershell , DOS .etc etc) method to accomplish this task quickly as manual process is very troublesome and take long time.
    Any help will be highly appreciated,
    Thanks,
    Suvajit Basu

    Hi,
    I dont have any script but seeking for a help.
    Thanks,
    Suvajit Basu
    In that case you should read this first:
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG
    Prewritten scripts can be found in the repository (Brent has already suggested one for you):
    https://gallery.technet.microsoft.com/scriptcenter
    If you can't find what you need and you can't write your own, you can request a script here:
    https://gallery.technet.microsoft.com/scriptcenter/site/requests
    Let us know if you have any specific questions.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Script for naming Layer-based Slices after Layers?

    Is there a script (PScc) for layer-based slicing in which the slices are named after their associated layers? I've done a lot of searching and it looks like this might have been in older versions of PS but I have not found anything recent.
    I don't have much experience with Javascript personally so I'm hoping someone has tackled this before. Thanks in advance!

    Have you seen the Adobe Generator which was released with 2014, it may be worth a look for you? Custom workflows with Adobe Generator in Photoshop CC | PHOTOSHOP.COM BLOG

Maybe you are looking for

  • Creating new record in Results Table giving Error

    Hi All, On update page there is a Results Table with Add button to create a new row. While creating a new record on Results Table gives error Attribute set for AccessId in view object XXLCUpdVariablesVO1 failed I have checked EO and VO attributes, ev

  • How to attach a pdf file to a message posted on this forum

    Hello All, I'm trying to attach a pdf file to a message that I'm going to post. I don't a way to do, although I see that I can attach image files. Is there a way to attach a pdf file or this is not allow on this forum?

  • Firwfox will not download using Windows vista - shows unknown publisher

    The unknown publishers issue seems to hinge on an problem with the digital signature. The error message is as follows: Internet explorer security warning Windows has found a problem with this file. Name: itunessetup.exe Publisher: unknown publisher T

  • Web Auth using 5760 Guest Anchor and ISE

    I am trying to deploy a new guest wireless solution using a 3650s as the MA, a 5760 as the MC, and a 5760 as the guest anchor.  ISE is being used as the guest auth server. When no auth requirements are set on the guest wlan, everything works fine.  I

  • Integrating LT slide with Photoshop image in FCE

    Hi all. I'm using LT to make text slides to integrate into an FCE project. Here's some background: my video opens with a LT slide, which is laid on top of (i.e., on the track above) a layered Photoshop image. Next, a few of the layers move, and the t