Script that gives specific names to layers - from bottom to the top

Hi,
This is probably an easy one for anyone with JavaScript experience.
I have 35 layers that I want to give specific names to (now they're named liked "layer 1, 2, 3" - but sometimes this won't be consistent, so some numbering might be skipped,
in other words I can't rely on a script that renames a specific "Layer 1" to "my name").
I want to rename each layer from the bottom to the top, i.e.:
"Power"
"Yellow"
"Hello"
With the script working its way up from the bottom to the top.
How do I accomplish this?
Thank you so much for you taking your time to help me.

something like this?
if so, type your names in a text frame, select it and run this script
// rename Layers from the bottom up
// carlos canto
// https://forums.adobe.com/thread/1653162
// type your names in a text frame, select it and run this script
var idoc = app.activeDocument;
var itext = idoc.selection[0];
var a_names = itext.contents.split ('\r').reverse();
var namecount = a_names.length;
var layercount = idoc.layers.length;
var counter = Math.min(namecount, layercount);
for (i=layercount-1, j=0; i>=layercount-counter; i--, j++) {
    var ilayer = idoc.layers[i];
    ilayer.name = a_names[j];

Similar Messages

  • When clicking websites my Avast 5.0 antivirus notifies me that a malicious URL is trying to access my system or that a Trojan has been prevented from access. The attempted Malware/Trojan is always from the same address:[Ticon.in/nte/kuz/.exe/xhdoe515bvo3

    suspicious Maleware / Trojan.
    == This happened ==
    Every time Firefox opened
    == I tried to access a website

    Hello "Morbus",
    Thank you for your quick and informative reply. First I would like to provide more information on this attempted Malware/Trojan. I have copied the full addresses for you and/or anyone who may have interest. It follows below.
    28.06.2010 07:38:00 Network Shield: blocked access to malicious site 楴祣湯椮⽮瑮⽥畫⹺硥e [ C:\program files\Mozilla Firefox\Firefox.exe ( 5436 ) ]
    28.06.2010 08:14:44 Network Shield: blocked access to malicious site 楴祣湯椮⽮瑮⽥畫⹺硥e [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 4476 ) ]
    28.06.2010 13:32:53 Network Shield: blocked access to malicious site 楴祣湯椮⽮瑮⽥畫⹺硥e [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 1988 ) ]
    28.06.2010 17:51:53 Network Shield: blocked access to malicious site 楴祣湯椮⽮瑮⽥畫⹺硥e [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 5400 ) ]
    29.06.2010 13:31:03 Network Shield: blocked access to malicious site ticyon.in/nte/kuz.exe [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 2444 ) ]
    29.06.2010 23:15:14 Network Shield: blocked access to malicious site ticyon.in/nte/kuz.exe [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 480 ) ]
    30.06.2010 09:36:22 Network Shield: blocked access to malicious site ticyon.in/nte/kuz.exe/wHd0e51a5bV03006f36002Ra38dbe4f108T9ccfa9f8Q000002fe901801F0035010aJ14000601L656e2d55530000000000 [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 5164 ) ]
    30.06.2010 22:31:52 Network Shield: blocked access to malicious site ticyon.in/nte/kuz.exe/wHd0e51a5bV03006f36002Ra38dbe4f108T9ccfa9f8Q000002fe901801F0035010aJ14000601L656e2d55530000000000 [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 3600 ) ]
    I had failed to mention in my previous comments that each time the attempted attacks took place, a blank Adobe PDF page appeared. As you suggested, I disabled the Adobe add-on and have had no further attacks. I am extremely dilligent in keeping my SuperAntiSpyware Pro, AvastAntiVirus 5.0, ThreatFire, Vista Firewall Control, Malewarebytes and Windows Defender up to date. However, after any attack I always run these in safe mode just as a precaution. I had suspected the Adobe drop-in may have been the culprit because of the page that appeared and your suggested fix has in fact fixed it!
    Thank you again for your unselfish time in coming to my rescue. "Deaf Dave"
    From: [email protected]
    Date: 7/1/2010 12:53:40 PM
    To: [email protected]
    Subject: Reply notification: when clicking websites my Avast 5.0 antivirus notifies me that a malicious URL is trying to access my system or that a Trojan has been prevented from access. The attempted Malware/Trojan is always from the same address:[ticon.in/nte/kuz/.exe/xhdoe515bvo38d
    "Morbus" has posted a reply to a thread you're watching.
    You can view the thread and reply at the following URL:
    https://support.mozilla.com/en-US/forum/1/714170#threadId714337
    Message:
    Hello Deaf Dave.
    It's possible that you are having a problem with some Firefox add-on that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?
    Whenever you have a problem with Firefox, whatever it is, you should make sure it's not caused by one (or more than one) of your installed add-ons, be it an extension, a theme or a plugin. To do that easily and cleanly, run Firefox in [http://support.mozilla.com/en-US/kb/Safe+Mode safe mode] (don't forget to select ''Disable all add-ons'' when you start safe mode). If the problem disappears, you know it's from an add-on. Disable them all in normal mode, and enable them one at a time until you find the source of the problem. See [http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes this article] for information about troubleshooting extensions and theme and [https://support.mozilla.com/en-US/kb/Troubleshooting+plugins this one] for plugins.
    If you need support for one of your add-ons, you'll have to contact its author.
    Also, it's possible that your system is infected with malware. To scan for malware, install, update and run these programs ''in this order''. They are all free for personal use, but some have limited functionality in their "free mode", but the features you'll miss are not really needed to find and remove the problem you have. Remember that ''not all programs detect the same malware''!
    Malwarebytes' Anti-Malware - [http://www.malwarebytes.org/mbam.php malwarebytes.org/mbam.php]
    SuperAntispyware - [http://www.superantispyware.com/ superantispyware.com]
    AdAware - [http://www.lavasoftusa.com/software/adaware/ lavasoftusa.com/software/adaware]
    Spybot Search & Destroy - [http://www.safer-networking.org/en/index.html safer-networking.org/en/index.html]
    Windows Defender - [http://www.microsoft.com/windows/products/winfamily/defender/default.mspx microsoft.com/windows/products/winfamily/defender/default.mspx]
    Dr. Web Cureit - [http://www.freedrweb.com/cureit/ freedrweb.com/cureit]
    If these don't find it or can't clear it, please tell me and I'll provide you with further assistance.
    Did this response solve your problem with Firefox?
    Yes, this solved my problem (click here):
    https://support.mozilla.com/tiki-feedback.php?id=714170&hash=6d5f163b3092b464aa15d04188b5cca2&type=forum_topic&feedback=Firefox%20Support%20Forum&commentId=714337
    No, this did not solve my problem (click here):
    https://support.mozilla.com/en-US/forum/1/714170?hash=6d5f163b3092b464aa15d04188b5cca2#form
    If you no longer wish to receive notifications for this thread,
    visit the following URL to cancel your subscription:
    https://support.mozilla.com/tiki-cancel_watch.php?section=forum&hash=6d5f163b3092b464aa15d04188b5cca2

  • Thinkpad X120e - SO MUCH heat from bottom of the laptop

    I Bought my new Leonovo Thinkpad X120e 10 days back. I get excessive heat from bottom of my laptop. I am unable to keep the laptop on my LAP for more than 5mins.. its so much heat. I am also getting heat from left side of the laptop. I think its from the heat ventilator. I installed TPFAN control software to look for temperatures. The CPU temp reads between 53 to 67 degree C.
    I took my laptop to a local lenovo service provider and he replaced he replaced Thermal module FRU 04W1380.. I thought the problem would be okay. But the same heat from bottom of the laptop and from side. The most annoying thing is the heat from bottom. I preferred small laptop as I can keep it on my lap and work for few hours. I am very disspointed with the heat. Can someone help me to solve this issue or is it normal that X120e dissipates heat from bottom of the laptop?

    http://www.notebookcheck.net/Lenovo-ThinkPad-X120e​-Laptop-Review.56445.0.html
    An outside temperature of 33 degreees C (91 F) is normal, according to Notebookcheck. That's at load. At idle, it says the x120e should hit 28 degress C (82 F).
    It also says that processor temperature gets up to 90 degres C (194 F). Your processor temperature is well within normal.
    28 to 33 degrees C is warm, but I'll bet my old x100e has you beat. Notebookcheck records the old x100e as reaching 61 degrees C (142 F) on the underside! I mean, it's no longer a matter of warm jeans and a red spot on my legs. The thing gets so hot I could turn it upside down and cook an egg.
    Check to see that your AMD processor is downclocking itself properly in the Power Manager settings. If your x120e is clocked up to maximum performance settings, it's going to run as hot as it can. If you dial it back, it'll run cooler and you'll save some battery life.
    http://www.notebookcheck.net/Review-Lenovo-Thinkpa​d-X100e-Subnotebook.26448.0.html

  • I'm wondering how to display "bullets" from the bottom to the top (last to first) in a slideshow.  Can anyone help?

    I'm wondering how to display "bullets" from the bottom to the top (last to first) in a slideshow.  Can anyone help?

    Select the set of bullets. Go to the "Build" panel of the Inspector. Choose "Build In". Choose your effect. Select "By Bullet Group" under delivery.
    Be sure to experiment with the various options.

  • Change the name "history", "back" and "forward" of the top-menu

    hello,
    how can I change the name "history", "back" and "forward" of the top-menu in another language??
    Thank you for every response.
    Regards,
    Sergio

    Sergio,
    I suggest opening OSS message with SAP on the issue.
    Translation for "history", "back" and "forward" of the top-menu to Romanian should be delivered with EP.
    If it was not done and SAP delivered partially translated content, SAP tech support should provide you with
    the solution. If you find it, please post to forum for the benefit of other people.
    Regards,
    Slava

  • Script that selects specific color coded layer?

    Hi Guys, does anybody knows how to find a layer in the layers palette using its color coding ?
    I've did this action for Photoshop for stacking layers on top of each other,basically it aligns one
    layer to another regardless of their position and size.Here is a demo how it works:  http://vimeo.com/13713886
    The action searches for the target layer via its specific name, using a simple .jsx script.This way the layer order in your document doesn't matter.However I don't want the action to rely on layer name either and was thinking that It can find the layer via its color coding
    I would be really glad if someone can write a script that searches trough all the layers in the layers palette and selects the color coded one.
    Thank you.

    This should do it...
    selectAllLayers();
    var selectedLayers =  getSelectedLayersIdx();
    for(var a=0;a< selectedLayers.length;a++){
        makeActiveByIndex( selectedLayers[a], false );
        if(colourMarkedLayer()) break;
    function selectAllLayers() {
    activeDocument.activeLayer = activeDocument.layers[activeDocument.layers.length-1];
    if(activeDocument.activeLayer.isBackgroundLayer)
    activeDocument.activeLayer = activeDocument.layers[activeDocument.layers.length-2];
    var BL = activeDocument.activeLayer.name;
    activeDocument.activeLayer = activeDocument.layers[0];
        var desc5 = new ActionDescriptor();
            var ref3 = new ActionReference();
            ref3.putName( charIDToTypeID('Lyr '), BL);
        desc5.putReference( charIDToTypeID('null'), ref3 );
        desc5.putEnumerated( stringIDToTypeID('selectionModifier'), stringIDToTypeID('selectionModifierType'), stringIDToTypeID('addToSelectionContinuous') );
        desc5.putBoolean( charIDToTypeID('MkVs'), false );
        executeAction( charIDToTypeID('slct'), desc5, DialogModes.NO );
    function getSelectedLayersIdx(){
          var selectedLayers = new Array;
          var ref = new ActionReference();
          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
          var desc = executeActionGet(ref);
          if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
             desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
              var c = desc.count
              var selectedLayers = new Array();
              for(var i=0;i<c;i++){
                try{
                   activeDocument.backgroundLayer;
                   selectedLayers.push(  desc.getReference( i ).getIndex() );
                }catch(e){
                   selectedLayers.push(  desc.getReference( i ).getIndex()+1 );
           }else{
             var ref = new ActionReference();
             ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
             ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
             try{
                activeDocument.backgroundLayer;
                selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1);
             }catch(e){
                selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )));
          return selectedLayers;
    function makeActiveByIndex( idx, visible ){
        var desc = new ActionDescriptor();
          var ref = new ActionReference();
          ref.putIndex(charIDToTypeID( "Lyr " ), idx)
          desc.putReference( charIDToTypeID( "null" ), ref );
          desc.putBoolean( charIDToTypeID( "MkVs" ), visible );
       executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
    function colourMarkedLayer(){
       var ref = new ActionReference();
       ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
       var appDesc = executeActionGet(ref);
       if(appDesc.getEnumerationValue(stringIDToTypeID('color')) != 1315925605) return true;
       return false;

  • Request - Perl script that can parse an ACE config from a VIP

    Has anyone ever written a Perl script that can take the VIP from an ACE config and parse it out into the component parts of the config, ACLs, NATs, Class-map, policy-map, etc. ?
    This seems like something someone must have written already.
    Thanks in advance!

    Any reason you dont want to use XML instead of doing just PERL ?  Its lot easier to do with XML scripts as ACE has a XML interface to query whatever is needed. So that said, you can use a perl to interface ACE via XML. Here's a simple Perl that uses LibCurl:
    #!/usr/bin/perl
    use WWW::Curl::Easy;
    my $numArgs = $#ARGV + 1;
    if ($numArgs<4)
    die("Usage: shusers.pl ip_address username password command\n");
    my $ip = @ARGV[0];
    my $uname = @ARGV[1];
    my $pwd = @ARGV[2];
    my $cmd = @ARGV[3];
    my $curl = new WWW::Curl::Easy;
    my $posturl = "http://$ip/bin/xml_agent/";
    my $xml_cmd = "xml_cmd=<$cmd/>";
    $curl->setopt(CURLOPT_HEADER, 0);
    $curl->setopt(CURLOPT_FRESH_CONNECT, 1);
    $curl->setopt(CURLOPT_URL, $posturl);
    $curl->setopt(CURLOPT_RETURNTRANSFER,1);
    $curl->setopt(CURLOPT_USERPWD,"$uname:$pwd");
    $curl->setopt(CURLOPT_POST,1);
    $curl->setopt(CURLOPT_POSTFIELDS, $xml_cmd);
    $curl->perform;
    my $info = $curl->getinfo(CURLINFO_RESPONSE_CODE);
    print $info;
    Hope this helps.
    Cheers
    V.K

  • I have two iPads about a year old and have 5 full folders of web links that I would like to copy from one to the other.  Both have iCloud but not the same account.  Is there an easy way to grab those folders or the icons and email?

    I have two iPad 2 with separate iCloud accounts.  I want to copy folders of weblinks from one iPad to the other.  Email solution?  Answer needs to be written for a user who doesn't know how to select a folder or a number of icons and email or copy them to something that can be emailed.  I know how to do it one at a time by opening weblink and then emailing the link from safari.

    Good idea. I've already used the feedback for my general suggestions to improve the way Apple handles bug reports (and tried sending it to Steve Jobs too), but I'll send a specific suggestion for a bug app on the iPhone.
    However, my question is whether there is a simple way to send bug reports from the iPhone now that I have overlooked.

  • How to stop Google from making site the top search result

    I created a website for a clinic that's part of a large hospital. Unfortunately when someone googles the name of the large hospital, the clinic's website with address, map and phone number, comes up first on the search results. So the poor clinic receptionist is fielding a lot of phone calls from people thinking the clinic's number is the hospital's general phone number.
    So first I removed the name of the hospital (except in an image) from the home page, and took the hospital name out of the address text. I tried using Google's URL removal tool to tell them to stop using the clinic website for the hospital name search. But each request there is marked denied after a few days. Even tried the Google option to have them reindex the site. So far nothing has worked, and it's been a month.
    So does anyone have any other ideas to try and get Google to de-rank or remove the clinic site from the hospital name search results?

    Thanks for the robot.txt idea. I didn't know about that.
    It seems that won't work though, as I still want all pages to be indexed so people can find the site when they are looking for just the clinic. It's just stopping the query for the hospital from returning the site.
    But I've now noticed that the actual site link is further down the search results, but the tiny map and address that show up at the top of the query ( i.e. when you search for a business) is being taken from the clinic address and website.
    I'm wondering if it's because I used the Google Map widget in the website. I'm going to try and replace the map widget with a gif of the map and see if that helps. Open to other ideas here too.

  • Customizing Spry Menu - Drop items different from tabs at the top

    How can I remove the background image from the dropped down items on a Horizontal Spry Menu while keeping the image for the tabs at the top? It seems every time I change something for the top tabs, the change is carried to the drop down menus as well.
    Here is a link:
    http://www.monicagraphicdesign.com/Bill/spiritual.html
    You can see what is happening if you hover over "About Bill"

    Open your SpryMenu.css file.  Scroll down a ways to this:
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
        left: auto;
        background-color: #000;
        background-image: none;
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
        background:none;
        width: 8.2em;
    Nancy O.

  • In mail how do I get the latest entries to appear at the top automatically, at the moment I have to move the cursor from the bottom to the top to read the latest email?

    In mail how do I get the latest emails to appear at the top of the column automatically. At the moment I have to scroll up from the bottom oldest entires to find my latest mail arrivals

    What device are you using?
    I assume you are talking about something other than the iPad?
    Is there a sort order above the date column? Clicking on this can switch between Ascending and Descending order.

  • How do you stop the help window from floating to the top?

    Is there way to change the help window's behavior so that it acts like a normal window?
    It takes so long to set up seeing the problem and the help at the same time, then go back to reading and then back again.
    The floating to the top is a very unwellcome "Feature" and microsoft-like not Apple-like.

    hmslfi wrote:
    The floating to the top is a very unwellcome "Feature" and microsoft-like not Apple-like.
    That depends on your POV. Some may prefer the default behaviour, because it doesn't allow the help window to be hidden by the working window.
    Also, keep in mind that you can use the Minimise (yellow) button in the window's title bar.
    However, if you really want to change the default floating window, there is a preference you can change with the defaults command:
    $ defaults write com.apple.helpviewer NormalWindow -bool true
    Alternatively, you can enable Help Viewer's developer mode
    $ defaults write com.apple.helpviewer DevMode -bool true
    (See
    <http://www.macworld.com/article/158482/2011/03/hidehelpviewer.html>
    for details.)

  • How do I stop Itunes from jumping to the top every time I delete an artist?

    Everytime I delete an artist from my Itunes, I am brought back to the top of my list and have to scroll down to where I left off, EVERY TIME. This is very frustrating.

    i have even turned off itunes helper in the log in menu.
    Did you remove iTunes Helper from your Login Items?
    If not, you need to remove it from the Login iTunes. Checking an item in your Login Items list hides the item during startup, it doesn't turn it off or not checking the item doesn't turn it off. You need to remove it from your Login Items list if not removed.

  • Help to stop Acordian from jumping to the top of the page

    I was planning to use the accordian for a FAQ's page,
    although I'm having a problem with it in IE.
    The FAQ's page is fairly long and if i click a tab that I
    have to scroll down to get to, then the accordian jumps back to the
    start of the page and fixed the top edge of the accordian to the
    top of the browser window (this is only happpening in IE7, and not
    in Firefox, and I havent had chance to check it in IE6 yet.
    Is there a way to stop this jump back to the top of the page
    happening for IE?
    To see the page i am working on and see what i mean, please
    look at
    http://82.110.105.91/osrec.com/demos/FAQs_DEMO/index.php

    Hi,
    The behavior you see in IE is because of an IE bug that
    appears when you try programatically focus an element to allow
    keyboard navigation. If you don't need keyboard navigation, which
    is default set on true for accordion, you can use an workaround to
    avoid tha jump to the beginning of the page.
    In the accordion constructor add this option
    enableKeyboardNavigation set to false
    (enableKeyboardNavigation:false).
    Doing this that jump goes way, but you'll not be able to
    navigate through accordion panels using keys.
    Diana

  • How do I keep my bookmarks from reseting to the top of the bookmark list once I've scrolled and clicked a bookmark?

    When I scroll down and click a bookmark, the next time I open my bookmarks, it is reset at the very top again. Example, if I have 50 bookmarks with 1 at the top and 50 at the bottom, if I scroll down and click 40. It loads. Then I want to go to 42. When I click Bookmarks, it has 1 at the top again and I have to scroll all the way down to get to 42. It was not like this in Firefox 1-4. How do I revert to the old way? Is there an extension for that?

    Maybe open the bookmarks in the sidebar: View > Sidebar > Bookmarks (Ctrl+B)
    Press F10 or tap the Alt key to bring up the "Menu Bar" temporarily if the Menu Bar is hidden.

Maybe you are looking for