How to remove the layer by name?

Hello

I currently have a script that removes the unused/white/empty layers:

var layers = app.activeDocument.layers.everyItem () .getElements ();

for (var i = layers.length - 1; i > = 0; i--) {}

{if(Layers[i].pageItems.Length==0)}

layers [i]. Remove();

}

}

but in addition to the unused layers, I need to remove layers which have a layer name that begins with a support "[]". Often, there are layers of model in our workflow which are not necessary - they are named differently but always begin with a hook. Example: [page 2] xxx - xxx-#.

I tried frankensteining in a piece of code that Jarek provided for another script that processes the names of swatch, but I'm afraid, I'm rather desperate (I intend to become less desperate... then maybe you will not always be overcome with dread seeing my messages... but it does not solve my (or your) problem now).

As always, I appreciate your consideration and help.

After the first appearance of the line

layers [i]. Remove();

try adding the line

continue;

Here, the reason may be that if a layer is empty, then it is removed, and

so it's no good trying to access his name since there is no

more. A command continue will force the loop to move on to the next

iteration instead of a wrong to move on to the next if statement.

Ariel

Tags: InDesign

Similar Questions

  • How to remove the author's name and/or date of blogsite summary

    Hello

    Can someone help me please find where and how to withdraw the name of the author of the summary blogsite?

    I don't want any author's name listed, just the title linked blog and the date of publication.

    Or, is it possible to have the related title, with 50 words of the displayed article, but no name of author or creation date?

    I thank very you much in advance!

    I figured out how to remove the CSS author (.blogsitesumary duration-date {display: none}, but any attempt to change via CSS does not work.)

    For example, I can't create more space between the title and the date, or list items.

    Also, I would still add the first words of the post.

  • How to remove the folder with name

    Hi all

    I had created a folder with a name, using ALT + 0160, but now iam not able to delete or rename it.pls tell me how to remove it.

    You get an error message when you try to delete it?

    Boot into safe mode and see if it will remove. If this is not the case, try this tool.

    Unlocker File Remover

    Download it from FileHippo
    http://filehippo.com/download_unlocker/

    Download from CNET
    http://download.CNET.com/WOT/3000-2378_4-75011499.html

  • How to remove the additional user name

    When I have regestered my first choice of username was already taken. How can I remove it

    Hi beautiful,
    I appreciate that you try to delete the user name that is already taken. When you try to create a user account?

  • How to remove the file/path name using the SDK

    I have a program that uses the Acrobat SDK from Adobe kit. It creates the aPDF file from a HTML file that is created after the jugs of program data. It can create PDF very well, but how can he do with on the file name and path in the lower left corner. Insert us the PDF file created in another document and that you do not want to display the data on these pages created.

    Sought through this site and can not see mentioned.   Help!

    How do you convert from HTML to PDF format?

  • Fireworks for wireframing - how to remove a layer of a page?

    Hello

    I use Fireworks for the first time to create a wireframe.  Have come some tutorials on adobe.com, I always get a grip on the behavior of the fireworks (I'm used to Photoshop and Illusrtator).

    I created all the General layers of the wireframe as a Master Page.  All pages are to display a sidebar, with the exception of a single page.  I understand how to add additional layers to the other pages, but I can't seem to find how to remove the layer of the sidebar of a page, unless it is removed from all pages.

    If anyone has any advice, they are greatly appreciated. Thank you.

    -Court

    In the layers panel, choose Remove Master Page in the menu options (in the top right of the Panel). This will remove all items in this page's master page; You cannot choose what parts of a page master to keep; It's a case of all or nothing.

    For the kind of flexibility you want, you can consider the use of shared layers.

    HTH

  • How to manually remove the layer application R12.1.3/Linux?

    Hello

    I use note 452120.1 doc. to remove the layer of apps. But as soon as the user interface appears, out wrong as follows:

    =====

    Environment variables:

    ORACLE_HOME =

    PATH = /ots/oracle/local/bin:/usr/local/bin:/bin:/usr/bin:/etc:/opt/bin:/usr/sbin:/sbin:/bin:/ots/oracle/boeing/oratools/6.1.1/bin:/usr/atria/bin:/usr/ccs/bin:/usr/ucb:/usr/openwin/bin:/opt/aCC/bin CLASSPATH = Username:oracle

    Error: * warning: abnormal termination of the program. An internal error has occurred. Please provide me with the following files to the Support of Oracle: "/ ots/oracle/oraInventory/logs/RemoveHome2014-05-08_08-15-54AM.log".

    'Unknown '.

    "Unknown."

    What is the problem? Can I remove it manually? If can what are the steps?

    Thank you!!!

    2625331 wrote:

    Hello

    I use note doc. 452120.1 remove the layer of apps. But as soon as the user interface appears, out wrong as follows:

    =====

    Environment variables:

    ORACLE_HOME =

    PATH = /ots/oracle/local/bin:/usr/local/bin:/bin:/usr/bin:/etc:/opt/bin:/usr/sbin:/sbin:/bin:/ots/oracle/boeing/oratools/6.1.1/bin:/usr/atria/bin:/usr/ccs/bin:/usr/ucb:/usr/openwin/bin:/opt/aCC/bin CLASSPATH = Username:oracle

    Error: * warning: abnormal termination of the program. An internal error has occurred. Please provide me with the following files to the Support of Oracle: "/ ots/oracle/oraInventory/logs/RemoveHome2014-05-08_08-15-54AM.log".

    'Unknown '.

    "Unknown."

    What is the problem? Can I remove it manually? If can what are the steps?

    Thank you!!!

    Yes - 11i: how to Clean Up The UNIX environment after EBS 11i installation fails (Doc ID 110372.1) - this doc is applicable to R12

    Thank you

    Hussein

  • Portege M400 - how to remove the condensation of water?

    I received a second hand toshiba portege m400 mail and saw there probably a condensation of water trapped between the external display and touch screen behind her. because the screen in the upper left corner looks whitish. and the sender of the laptop said he wasn't there when he sent it. I have a picture of trapped moisture, for those who want to see it.

    so, I opened the screen by unscrewing. and I saw that most of the moisture is stuck between the external screen glas and one other layer behind him, which I guess, is the part of the touch screen. who looks inaccessible. These 2? the layers form the upperpart of the screen.

    the lcdscreen with all the electronics in this layer, form the lower part of the screen or if you want, cover. This part is now oke. He also had a condensation of water on it and I was able to gently wipe the little moisture of the lcdscreen without problem. This helped a bit with this problem.

    but moisture remains trapped between the part of the touchscreen layer and this layer of glass in the upperpart of the screen/cover.

    hoping to evaporate the moisture, I left the enlightened a bit more open for a day, I broke even the upperpart and the lowerpart of the screen. I applied a little of an infrared lamp, a remote backup heat. anything that did not help.

    * so, how can I remove the condensation of water? *

    * is there a way to remove a layer in the upperpart of the screen to reach the humidity? *

    Hello olekike

    Please don t get me wrong, but I'm afraid, you need professional with this Mr. help as I see that your question is not answered for days now, and I think that nobody here has a lot of experience with this stuff.
    View replacement OK but how to remove the condensation of water on the touchscreen is perhaps too heavy for us.

    I recommend strongly to contact the nearest Toshiba service provider and ask for help. talking with the guys what we can do about it.

  • any ideas on how to remove the software malicious zebrouss?

    any ideas on how to remove the software malicious zebrouss?

    This thing I replaces my setting of search in safari - can get rid of it - don't know who got it

    You may have installed ad-injecting malicious software ("adware").

    Do not use any type of product, "anti-virus" or "anti-malware" on a Mac. It is never necessary for her, and relying on it for protection makes you more vulnerable to attacks, not less.

    Save all data first.

    Some of the most common types of adware can be removed by following the instructions from Apple. But before you follow these instructions, you can try an automatic removal.

    If you are not already running the latest version of Mac OS X ("El Capitan"), update or upgrade in the App Store you could adware to automatically remove. If you are already using the latest version of El Capitan, you can still download the current update of the Apple Support downloads page and run it. Still, some types of malware will be deleted, not all. There is no such thing as the automatic removal of all possible malware, either by OS X third party software. That's why you can't rely on software to protect you.

    If the malware is deleted in your case, you will still need to make changes to the way you use your computer to protect you from new attacks. Ask if you need advice.

    If the malware is not automatically deleted, and you cannot remove yourself by following the instructions from Apple, see below.

    This simple procedure to detect any type of adware that I know. Disabling is a procedure distinct and better still.

    Some legitimate software is funded by advertising and may display advertisements in its own windows or in a web browser while it is running. It's not malware and it may not appear. In addition, some Web sites display advertising intrusive popup that can be confused with adware.

    If none of your web browsers work well enough to carry out these instructions, restart the computer in safe mode. Allows to temporarily disable the malware.

    Step 1

    Please triple - click on the line below on this page to select it, and then copy the text to the Clipboard by pressing Control-C key combination:

    ~/Library/LaunchAgents

    In the Finder, select

    Go ▹ go to the folder...

    from the menu bar and paste it into the box that opens by pressing command + v press return. Open a folder named "LaunchAgents", or you will get a notice stating that the file cannot be found. If the file is not found, proceed to the next step.

    If the folder opens, press the combination of keys command-2 to select the display of the list, if it is not already selected. Please don't skip this step.

    There should be a column in the update Finder window. Click this title two times to sort the content by date with the most recent at the top. If necessary, enlarge the window so that all the content show.

    Follow the instructions in this support article under the heading "take a screenshot of a window." An image file with a name starting in 'Screenshot' should be saved to the desktop. Open the capture screen and make sure it is readable. If this isn't the case, capture a small part of the screen indicating that what needs to be shown.

    Start a reply to this message. Drag the image file in the editing window downloading. Alternatively, you can include text in the response.

    Leave the case open for now.

    Step 2

    Do as in step 1 with this line:

    /Library/LaunchAgents

    The record which can open up will have the same name but is not the same as in step 1. In this step, the folder does not exist.

    Step 3

    Repeat with this line:

    /Library/LaunchDaemons

    This time the file will be called "LaunchDaemons."

    Step 4

    Open Safari preferences window and select the tab 'Extensions'. If the extensions are listed, post a screenshot. If there are no extensions, or if you cannot launch Safari, skip this step.

    Step 5

    If you use Firefox or Chrome browser, open the list of extensions and do as in step 4.

  • I want to know how to remove the back cover of my HP Pavilion Sleekbook 15 to install the new memory?

    I want to know how to remove the back cover of my HP product name: HP Pavilion Sleekbook 15 to install the new memory?  All site shows HP Web is how remove caches memory.  Unfortunately, with the newer models like mine, the whole back cover needs to be removed.  I have tried in vain to remove it, but so far all that I managed to do is scratch my cover.  If anyone can help?

    Dear David

    It's a very good idea, it would also be a good excuse to use my new phone for this.  So I'll say thanks again for the good advice.  Have a great weekend you Mr.  As I said earlier, you're a star...

    Yours Sincerely

    Alan

  • How to remove the virus boostspeed.exe

    How to remove the virus boostspeed.exe

    Hi Laurence,.

    As far as I KNOW, you're talking about Auslogics Bootspeed, and it is a program (even if some consider how he acts and what he does to be very similar to how the system will react as if he was infected).  For technical support, see: http://www.auslogics.com/en/support/.

    If it's this product, there seems to be any special product online removal process (but perhaps custom support can help). If it isn't this product or there is nothing like it on your system, then why do you assume that it is a virus - are guessing you or some AV programs, told you that (and if so, which) and how locate you the file name as being the problem?  What is the full path to the file (for example, C:\Program Auslogics... or other)?    What security software you have installed (all names and the exact version of each)?  What version of Windows are you using?  Indeed, please see http://support.microsoft.com/kb/555375 for ideas on other information that will help us.  The more we know, the better we can help and the more focused we can make recommendations.

    I would try the following: start by creating a system restore point, and then back up the registry as well (just to be on the safe side).

    Download the free Revo: http://www.revouninstaller.com/revo_uninstaller_free_download.html and use it in advanced mode to completely remove Auslogics Bootspeed.  If it does not work because it says it is running (which is possible if there is probably not), then start safe mode and try again to remove use Revo in Mode safe.  The chances of success are much higher now that it is not likely to be running in Mode safe.

    I hope this helps.  Please get back to us in all cases, and if it haunts you again, please answer these questions as well as what happened when you tried to remove it as suggested.  On this basis, we will have a better idea if we treat just a difficult program to remove or legitimate an infection of any (or possibly both) and take the necessary measures from there - but we need to learn more and to see if the simple answer works (or why it failed).  We desperately need your help here (provision of information) to be able to help (with recommendations and options and courses of action - or more questions).

    Thanks and good luck!

    Kosh

  • How to remove the trash-1000

    How to remove the Trash-1000 folder in external HARD disk? There is also a folder "System Volume Information" how to remove it without making this player?

    Hello

    Thank you for contacting Microsoft Community.
    Of the System Volume Information folder cannot be deleted. It is a system folder and user operations cannot be performed on him (as the name change, deletion, movement, access/change properties).
    You can delete the folder Trash-1000. It is created if the player is connected to a Linux system. It's where the deleted files/folders, so SHIFT + DELETE are stored is not used or completely deleted from the Recycle Bin. The 1000 is the UDI of the user account that created the file.
  • How to remove the upgrade Windows 7 Professional of D:-drive?

    I bought Windows 7 Professional Upgrade from Windows Vista Home Basic. HUGE MISTAKE! On the Microsoft Store is a nightmare. Finally, I just received a refund. Now, how do the Windows 7 on my D drive where is where idiots to the Microsoft sortore had me download in the first place. now I have vista on drive c and one broke * windows 7 on drive d. HELP, apparently, not a microsoft support t know how?

    If the Visa is still functions (you can load a running Vista), then install EasyBCD and follow the instuctions for EasyBCD listed below. When you are finished with the removal of Windows 7 in the boot (according to instructions) menu, then you can reformat the D: partition, which is where you said Windows 7 was installed.

    ================================================

    EasyBCD - how to remove the invalid entry:
    http://NeoSmart.NET/DL.php?id=1

    When you run EasyBCD, you will see the following great tabs/buttons on the left.

    (1) the display settings: displays the number of entries (bootable version valid and is no longer valid to Windows). The one marked 'default' in the version of Windows that starts if you sit and wait 30 seconds without making a selection using the keyboard. The entrance of remaining are classified by 'Name' (unless renamed all entires will call Windows 7). Drive letter represents the partition that version. If everything that you installed multiple copies of Windows 7 and Vista the path "Bootloader" will always be the same.

    (2) menu of Boot edit: four options 'Up', 'Down', 'Rename' (is very convenient if you want to see a significant name when you first start (I have 5 versions of Windows on one of my test systems, so I reamed the plain jane "Windows 7" "Windows 7 Pro 64-bit" and "Windows 7 Home Premium 32 - Bt, etc." ").)
     
    The last option is "Delete", click on the entry of is no longer valid (for highlight), and click 'delete '.

    You will also see a check mark in the "default" (when 30 timeout expires) version of Windows (vista in your case), the computer will start to place a check mark to one you want to keep.

    Located at the bottom of 'edit Boot Menu' page is the time-out value, if you want automatically to your only remaining version of Windows just place a check mark in the box "Skip boot menu."

    When your done with your changes, be sure to 'Save Settings'.

    J W Stuart: http://www.pagestart.com

  • How to remove the menu by default oracle froms 6i

    How to remove the default window menu Oracle forms 6i.

    Amatu Allah Neveen Ebrahim wrote:

    As Salamu Asalam we Rahmatu Allah we Barakatu,.

    How are Hamid, you?

    The OP wondered about: form Menu of the window no.

    Best Regatds,

    Amatu Allah.

    Walikum As Salam O Rahmatillahi we Barakatu, sister Amatu Allah.

    Alhumdolilah. How about you?

    Average don't want to see window menu name?

    Oh, so that's that.

    1. quastion in THE HOW TO REMOVE MENU 'WINDOW' of ORACLE FORMS

    Hamid

  • How to remove the decimal value (. 00) of the slider control

    Please ask me how to remove the decimal value (. 00) of the slider control and Add (if possible) % in after effects cs6.

    I guess you mean to animate text with a slider.

    Add a slider (options for expressions) to your text layer and then add this expression in your Source text:

    x = Math.Floor (effect ("Slider Control") ("Slider"));

    x+" %"

    That's all

Maybe you are looking for