Need Script to remove unused elements...

anyone know of a script to remove:
all unused paragraph styles
all unused character styles
all unused swatches
all unused table styles
all unused cell styles
all unused object styles
all unused master pages
Please let me know

Can you not tag along a running discussion with a totally different subject?
Please keep the forum tidy and use the Start a discussion link to start a new discussion. It also helps to enter a descriptive title; "please help me" is not one.

Similar Messages

  • IDCS6 MACOSX JS: "remove unused layer" script doesn't see masters based on masters

    Hello everybody.
    I have an old script that I have used many times to remove unused layers. Until today I thought it worked well:
    var layers = app.documents[0].layers.everyItem().getElements();
    for(var i=layers.length-1;i>=0;i--){
      if(layers[i].pageItems.length==0){
        layers[i].remove();
    However, today I used the script on a document that had a layer that was only ever used once on a master page that the other master pages were based upon. To my surprise, when the script was run, this specific layer was deleted.
    my scripting knowledge is poor, but looking at the script it looks like the script is looking at all layers that have anything in them, and any layer that has no item is to be deleted. however, I think that pageItems only refers to regular pages or master pages, not masters BASED ON other masters.
    I think the problem is similar to another that I had recently where I had a script that removed unused masters, but removed masters that other masters were based on, and I think the principles are the same. That thread can be found at:
    http://forums.adobe.com/message/5922004#5922004
    in short, the script that worked there was as follows:
    xUnusedMasters(myDoc);
    function xUnusedMasters( docRef ) {
    var mpNames = new Object () ;
    var allPages = docRef.pages ;
    for ( var pIndex = allPages.length - 1 ; pIndex >= 0 ; pIndex-- ) {
    mpNames = addMasterName ( mpNames , allPages[pIndex] ) ;
    var allMasterPages = docRef.masterSpreads ;
    for ( var mpIndex = allMasterPages.length - 1 ; mpIndex >= 0 ; mpIndex-- ) {
    if ( ! mpNames[allMasterPages[mpIndex].name] ) {
    allMasterPages[mpIndex].remove() ;
    return ;
    function addMasterName ( MPDB , pageRef ) {
    if ( pageRef == null ) { return MPDB ; }
    if ( pageRef.constructor.name == 'MasterSpread' ) {
    MPDB[pageRef.name] = true ;
    return addMasterName ( MPDB , pageRef.appliedMaster ) ;
    is it possible to modify the above script so that instead of removing unused master pages, it removes unused layers in a similar fashion?
    Many thanks,
    Colly

    Hi,
    Maybe a little bit different way...:
    Array.prototype.filter = function(collection) {
              var k, i, con, ids = collection.everyItem().id;
              con: for (k = ids.length - 1; k >=0; k--)
                        for (i = 0; i < this.length; i++)
                        if (this[i].id == ids[k]) {
                             ids.splice(k, 1);
                             continue con;
              return ids;     // array with unmatched ids from collection
    var
              mL = app.activeDocument.pageItems.everyItem().itemLayer,
              mUnusedLayersID = mL.filter(app.activeDocument.layers),
              len = mUnusedLayersID.length;
    while (len-->0)
              app.activeDocument.layers.itemByID(mUnusedLayersID[len]).remove();
    mL is an array with each pageItem's layer;
    filter compares it to doc.layers collections;
    unmatched means unused so are removed.
    Jarek

  • Need help retrieving my photoshop elements 2.0 due to virus scan removing it

    need help retrieving my photoshop elements 2.0 due to virus scan removing it - i have everything removed from scan in quarantine but have no idea which  one is what i need to reverse and allow my photoshop elements 2.0 (old version, I know, but I love it) to work again

    Use the anti-virus program to reverse everything it quarantined and in future ensure the anti-virus program settings let you check and decide what items to quarantine and what to ignore. Letting an anti-virus program quarantine things automatically is a recipe for disaster.
    You could also check if you have a System Restore point from before the anti-virus run.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • Need script for Marginal Elements consists two tags

    Hi Everyone,
    I need a script for the Marginal Elements having two Paragraph tags. Object Styles, Library items are all availale for this job. My requirement is cut the two paragraph tags and put it in library items and also using object styles as well. Is it possible? Can you help for this. For more clarification i have attached that file also.
    Waiting for your reply....

    Hi Try This code.....
    main();
    function main(){
        if (app.documents.length!=0){
            if(app.libraries.length!=0){
            myStyleDialog();
            else {
                alert ("Please open the Library.");
        else {
            alert ("Please open a document and try again.");
            exit(0);
    function myStyleDialog(){
    var myLabelWidth = 120;
    var myParaStyleNames = myGetParagraphStyleNames();
    //var myObjStyleNames = myGetObjectStyleNames();
    var myDialog = app.dialogs.add({name:"Choose Styles to Place Anchor"});
    with(myDialog.dialogColumns.add()){
        with(borderPanels.add()){
            with(dialogColumns.add()){
                with(dialogRows.add()){
                    with(dialogColumns.add()){
                        staticTexts.add({staticLabel:"Choose Paragraph Style1:", minWidth:myLabelWidth});
                    with(dialogColumns.add()){
                        myParaStyleDropdown1 = dropdowns.add({stringList:myParaStyleNames, selectedIndex:0});
                  with(dialogRows.add()){
                        with(dialogColumns.add()){
                            staticTexts.add({staticLabel:"Choose Paragraph Style2:", minWidth:myLabelWidth});
                        with(dialogColumns.add()){
                            myParaStyleDropdown2 = dropdowns.add({stringList:myParaStyleNames, selectedIndex:0});
    //~                     with(dialogRows.add()){
    //~                         with(dialogColumns.add()){
    //~                             staticTexts.add({staticLabel:"Object Styles:", minWidth:myLabelWidth});
    //~                             }
    //~                         with(dialogColumns.add()){
    //~                             myObjectStyleDropdown = dropdowns.add({stringList:myObjStyleNames, selectedIndex:0});
    //~                     }
    //~         }
        myReturn = myDialog.show();
        if(myReturn == true){
             myParagraphStyle1 = myParaStyleNames[myParaStyleDropdown1.selectedIndex];
            myParagraphStyle2 = myParaStyleNames[myParaStyleDropdown2.selectedIndex];
            // myObjectStyle = myObjStyleNames[myObjectStyleDropdown.selectedIndex];
             myDialog.destroy();
          else {
          myDialog.destroy();
    function myGetParagraphStyleNames(){
        var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name;
        return myStyleNames;
    //~ function myGetObjectStyleNames(){
    //~     var myObjStyleNames = app.documents.item(0).objectStyles.everyItem().name;
    //~     return myObjStyleNames;
    //~ }
    var myDoc = app.activeDocument;
    var myStory = myDoc.stories;
    var myParas, myCount = 0;
    var myLib = app.libraries[0];
    var AnchorItemName = prompt("Enter the Library Item Name Exactly","","Anchor Item");
    for(i=0; i<myStory.length; i++)
        myParas = myStory[i].paragraphs;
        if (myParas.length>3)
            for(j=0; j<myParas.length-1; j++)
                var firstPara = myParas[j];
                var nextPara = myParas[j+1];
                var firstParaStyle = firstPara.appliedParagraphStyle.name;
                var nextParaStyle = nextPara.appliedParagraphStyle.name;
                if ((nextParaStyle == myParagraphStyle2)&&(firstParaStyle == myParagraphStyle1))
                    myText = myLib.assets.item (AnchorItemName).placeAsset (firstPara.insertionPoints[0])[0];
                    firstPara.move(LocationOptions.after, myText.insertionPoints[0]);
                    nextPara.move(LocationOptions.after, myText.insertionPoints[-1]);
                    myText.fit(FitOptions.frameToContent);
                    myCount++;
                    }//End if
            }//End of Para iteration
        }//End of If paralength>2
        }//End of story iteration
    alert(myCount + " Ocurrences Found and Processed");
    Green4ever

  • I need to reinstall my Photoshop Elements 12 SN removed

    I need to reinstall my Photoshop Elements 12 < removed>

    Please don't ever post a serial number here. This forum is visible to the entire internet and you just gave it away to anyone who wanted it.
    What is the problem with reinstalling? You really haven't told us anything except your serial number, which does nobody here any good, since we are just other customers like you. More information, please.

  • Remove blank element in array

    need help how to remove empty elements in an array?

    Hi jeyanthi,
    if you want to delete somthing from a txt file, you have also first to read the data, remove the part you want and to write the new data into the file. So i think you can do it with the array version. For example something like this:
    Mike
    Message Edited by MikeS81 on 06-09-2008 09:32 AM
    Attachments:
    Unbenannt1.PNG ‏6 KB

  • [svn:fx-trunk] 15795: Initial check-in for removing unused rsls and the include-inheritance-dependencies-only features .

    Revision: 15795
    Revision: 15795
    Author:   [email protected]
    Date:     2010-04-28 14:01:58 -0700 (Wed, 28 Apr 2010)
    Log Message:
    Initial check-in for removing unused rsls and the include-inheritance-dependencies-only features.
    Changes to implement ?\226?\128?\147remove-unused-rsls feature. When the configuration option is true, RSLs associated with RSLs that are not used by the application are not loaded at runtime. The compiler logs the primary RSLs that are required with the number of failovers, if any.
    compiler/src/java/flex2/compiler/common/Configuration.java
                add ?\226?\128?\147remove-unused-rsls and ?\226?\128?\147include-inheritance-dependencies-only.
    compiler/src/java/flex2/compiler/CompilerSwcContext.java
                pass rslGroup to getSwcGroup.
    compiler/src/java/flex2/compiler/swc/SwcCache.java
                Add parameter to getSwcGroup to a group of rsls can be passed in.
    compiler/src/java/flex2/compiler/swc/SwcGroup.java
                Add a SwcGroup constructor that accepts a SwcGroup of Rsls. Use the RSLs to give preference to scripts that come from RSLs when duplicate scripts are merged.
    compiler/src/java/flex2/tools/CompcPreLink.java
    compiler/src/java/flex2/tools/PreLink.java
                Find the set of SWCs that are contributing code to the application. Use this set to restrict which RSLs are written to the generated root class. Log the RSLs that are required to give the user some feedback.
    compiler/src/java/flex2/tools_en.properties

    Ah, ok. I was in the assumption the PCI connect had something to do with the video connection. But it seems like Apple wanted to reinvented PCIe...
    I'm out of my territory here so feel free to ignore the following.
    These are the things I notice in your Xorg.0.log:
    [    19.474] (==) modesetting(G0): Depth 24, (==) framebuffer bpp 32
    [    19.474] (==) modesetting(G0): RGB weight 888
    [    19.474] (==) modesetting(G0): Default visual is TrueColor
    [    19.474] (II) modesetting(G0): ShadowFB: preferred YES, enabled YES
    [    19.500] (II) modesetting(G0): Output VGA-1-0 has no monitor section
    [    19.526] (II) modesetting(G0): EDID for output VGA-1-0
    [    19.526] (II) modesetting(G0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
    [    19.526] (==) modesetting(G0): DPI set to (96, 96)
    What the hell is modesetting doing there?
    And have you tried the nvidia blob? It could be that this is not well supported by nouveau. Maybe check up with their IRC / mailing list.

  • Vb scripts to remove the user from the member of perticular group (say from domain admin) from windows servers 2003 and 2008

    Hi,
    I need VB script which to checks the perticular user in AD and if it exists;that user needs to be removed from the member of perticular group
    Ex:- Lets say
    I have a user 783562 , I need to search this user in AD to verify user exists or not. If not then I no need to remove the mebership from perticular group
    Second scenario:-
    If user exists then I need to remove the user membership from the perticular group.I want to do it in automation
    Manual Path:-
    1.Type dsa.msc in run command of IT session(we using it to connect remote desktop).
    2. Select the domain & right click (EX:-corp.ds.xxyyzz.com) and select "Find" to find the user form the domain.
    3. Type the user name in the Name field and click on "Find Now" button user name will be displayed in search result.
    4. Double click on this user ID and select "Member Of" tab.
    5. Select any member of group from the Name section then click on "Remove" button.
    6. Finally click on "Apply" and "OK" button.
    Kindly help me out to do this by using vb script.
    Thanks
    Raja

    Usage: CScript NameOfVBS.vbs //NOLOGO /User:Jane.Doe /GroupDN:CN=Group1,DC=Contoso,DC=com
    Option Explicit
    On Error Resume Next
    Dim str_User
    Dim str_GroupDN
    Dim obj_Connection
    Dim obj_Command
    Dim obj_RootDSE
    Dim str_DNSDomain
    Dim str_Base
    Dim str_Filter
    Dim str_Attributes
    Dim str_Query
    Dim obj_RecordSet
    Dim obj_Group
    Dim str_ADsPath
    Dim obj_User
    str_User = WScript.Arguments.Named("User")
    str_GroupDN = WScript.Arguments.Named("GroupDN")
    If Len(Trim(str_User)) > 0 And Len(Trim(str_GroupDN)) > 0 Then
    Set obj_Connection = CreateObject("ADODB.Connection")
    Set obj_Command = CreateObject("ADODB.Command")
    obj_Connection.Provider = "ADsDSOOBject"
    obj_Connection.Open "Active Directory Provider"
    Set obj_Command.ActiveConnection = obj_Connection
    Set obj_RootDSE = GetObject("LDAP://RootDSE")
    str_DNSDomain = obj_RootDSE.Get("defaultNamingContext")
    str_Base = "<LDAP://" & str_DNSDomain & ">"
    str_Filter = "(&(objectCategory=person)(sAMAccountName=" & str_User & "))"
    str_Attributes = "cn,ADsPath"
    str_Query = str_Base & ";" & str_Filter & ";" & str_Attributes & ";subtree"
    obj_Command.CommandText = str_Query
    obj_Command.Properties("Page Size") = 1000
    obj_Command.Properties("Timeout") = 1
    obj_Command.Properties("Cache Results") = False
    Set obj_RecordSet = obj_Command.Execute
    obj_RecordSet.MoveFirst
    If obj_RecordSet.RecordCount = 0 Then
    WScript.Echo str_User & " was not found"
    Else
    Set obj_Group = GetObject("LDAP://" & str_GroupDN)
    str_ADsPath = obj_RecordSet.Fields("ADsPath")
    Set obj_User = GetObject(str_ADsPath)
    obj_Group.Remove(obj_User.AdsPath)
    If Err.Number = 0 Then
    WScript.Echo str_User & " was removed from group " & str_GroupDN
    ElseIf Err.Number = -2147016651 Then
    WScript.Echo str_User & " not a member of group " & str_GroupDN
    Else
    WScript.Echo str_User & " error removing from group " & str_GroupDN
    End If
    End If
    End If

  • Be abble to automatically remove unused resultLists, after onTheFly reporting, onTheFly DB writing ...

    Hello,
    If you get memory problems, you had to tune your reports options, result collecting, load / unload modules  .... 
    These tasks are very long, you have to point all memory consumers first ... It pollutes your test sequence only for memory purposes ! 
    When you try to modify the result reccording, you will also have problems for your report generation ... 
    It should be nice to add a new feature allowing an automatic result list removing, after onTheFly reporting, ontheFly database writing have treted them ...
    A kind of "OnTheFly and remove unused results"
    When ontheFly reporting, and The OnTheFly database writing are over, the treated resultList should be put in a garbage structure !
    Older test results could be removed if memory is needed ... 
    I know this could be not simple ... but this could help very much, for big sequences creation. 
    Thanks a lot.
    Manu.net (TestStand memory dustman !)
     

    Guys, I think I've found the strange thing.
    First, in the recovery shell, when I type "lvm lvscan", it prints:
    WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
    and then it says that all four my logical volumes root,boot,home and var are inactive.
    So I tried to set them up manually, with "lvm vgchange -a y", and guess what happened: I was able to boot!
    I still haven't managed to understand the real causes of this problem, but basically it seems that I have the same problem explained here: https://bbs.archlinux.org/viewtopic.php?id=184340.
    The only difference is that there the OP says to have solved the problem with an upgrade to Linux 3.15.7, while it appeared to me with the upgrade to 3.18.3, and as I said it doesn't go away neither with a downgrade nor with another upgrade to version 3.18.4
    Last edited by rdm (2015-01-29 21:55:44)

  • How to remove unused objects from the webcatalog In OBIEE11g

    Hi,
    I want to delete unused objects from obiee11g catalog, i know in obiee10g it's working fine (i.e: we can do it via manage catalog then delete the unused objects) is there any way to do it automatically like RPD utility --->removing unused objects from Physical layer in RPD
    fyi: I don't want to delete manualy. i need somethink like button/link to find unused objects(report,filter,folder..etc) from my obiee11g catalog.
    Thanks
    Deva
    Edited by: Devarasu on Nov 29, 2011 12:06 PM
    Edited by: Devarasu on Nov 29, 2011 3:15 PM

    Hi,
    Checked with Oracle Support team and confirmed below points
    --> incorporated into the Current product and consider as BUG it may resolve future release
    --> Currently there isnt any automatic method to remove the unused objects like reports, filters,folder etc from catalog.
    Treated as Bug
    Bug 13440888 - AUTOMATICALLY REMOVE OF UNUSED CATALOG OBJECTS FROM WEBCATALOG
    FYI:
    SR 3-4984291131: How to remove unused objects from the webcatalog in obiee11g
    Thanks
    Deva

  • Thread FAQ:findind removed collection elements

    Hi All
    i have two threads and one collection with some elements ,The problem is one removed some elements in collections now i want to find out elements removed by thread one with thread two

    Well they're not in the collection any more, are they? so the thread that removed them will have to remember them somewhere, or else the other thread will need a copy of the original collection.
    It's not a Thread FAQ question. Any two classes that used the collection would have the same issue.

  • Does Flex Builder remove unused code?

    Hi, I have alot of dead code in app that is resulting in an unnecessarily large SWF. Is there a way to make the flex compiler remove unused functions?

    Although tedious, drkstr_1 has the plan of action. Generally you should need to clean up orphaned code and remove all trace statements. I often see the tracing statements of other Flash Player products when doing development and some are quite revealing if not embarrasing.
    Also "unnecessarily large swf" begs the question what is large? If in Flash IDE did you run the bandwidth report to see exactly what makes it "unnecessarily large swf". You see this option in the publish settings.
    Typically code is not going to make a "unnecessarily large swf" but rather digital assets embedded and fonts embedded. Code could make it "unnecessarily large swf" if there are lots of libraries you are using and you are only using some tiny part of the library which you could refactor or find a snippet on the net.
    Last "unnecessarily large swf" in relation to what bandwidth? Do you have a targeted minimum bandwidth to make the assessment "unnecessarily large swf"?

  • Removing unused media from Sequence cause crashing

    I am trying to remove unused media from projects prior to archiving to free up/clean up finished projects. Each project I have tried to do this with I am having the program close during process. Then when I try to reopen project it will not open and keeps crashing. Firstly are these project now corrupt, and can I still archive them somehow or get the project back?? Please help as the projects I have tried to do this with aren't of huge importance but I do need to try to clean up and archive others that are.

    It is safe to use the media manager...
    Check your hard drive for space...for 30 mins means you'll need at least another 6.5 GB of free space... make it 8GB to be safe...
    In media manager (NOTE : also read the manual carefully) use the COPY option...
    Using COPY, ensure the 'duplicate selected items and place into a new project' box IS ticked, this will set up a completely new project and folder, containing ONLY EVERYTHING you have in your 30 min sequence... and will not delete or change anything from the origonal... If you go to the new folder you'll see another folder called 'media'... this will contain all the clips etc.
    Then, open up the new COPIED project, watch it to check it's ok... if it's cool (which it should be) then you now have a completely independant project that is nothing to do with the origonal... and contains only used media.
    Then, open up final cut pro docs>capture scratch> 'project name' and you can simply delete ALL your old media manually, knowing that everything you need is now in a new folder elsewhere....
    Of course, this only works if you have that little bit of extra space left on your drive for the new media to be copied to... but i find it's the safest, and easiest way of removing unused media.

  • How to manually remove Photoshop Elements 4.0 from Windows

    My uninstaller for Photoshop Elements 4.0 in Add or Remove programs fails with the message - "This action is only valid for products that are currently installed." The program folder still resides on my harddrive. The program itself neither runs nor will it allow me to delete the program files' Photoshop Elements 4.0 folder that contains the executable and dll files from my harddrive. I need a manual uninstall proceedure.

    Have you got the disc? If so, you might try installing it again then an uninstall.
    Failing that...
    Here's the Adobe tech doc on removing Photoshop Elements 5. I would assume it would be the same procedure.
    http://kb2.adobe.com/cps/333/333201.html

  • Removing unused items / optimizing file size

    I have a large swf that is embedded in Director as a sprite.  I now want to put it onto a web page, so file size is critical.  Is there a way to remove unused library items when publishing so that file size is reduced?  Is there another way to compress the swf so it is much smaller?  The current size is about 25 Mb.  What about streaming the swf?  I'm not talking about streaming video or audio, just any Flash content.  Any tricks for speeding the process up so that the user doesn't have a long wait before the swf starts?
    In Director, there is a way to right-click on a cast member and choose "find in score".  If something isn't found it means that it either is not used in the movie or is implemented through code.  Is there a similar way in Flash of detecting unused items or automatically eliminating them when publishing?
    Thanks,
    Brian

    all used assets would have to be downloaded eventually but it's a much nicer user experience to promptly see something useful on-stage, sooner rather than later.  background sound, for example, need not be downloaded when a page first loads and should download after items more useful to the user have already downloaded.
    under file/publish settings/flash/tick generate size report you can see what's bloating your swf.

Maybe you are looking for

  • 2 step MM STO transfer

    Dear Gurus, We have a requirement for SLOC1 to SLOC2 transfer.  I know that 313-315 could easily solve this, but there's a particular requirement as follows: 1.  Scan Stock Transfer Plan Print out (some kind of an order printout) 2.  Barcode scanner

  • Some files not showing up in iPhoto

    I used the Grand Perspective app on my iPhoto library package to find large video files I could reduce to save space. In the process, I've found some files that are in the package but aren't displayed in iPhoto. If I do a search for the file in iPhot

  • Could not complete this operation, an assertion has failed

    The massage appears, when I click Save for Web command. I have Photoshop CS3 Extended, Windows Vista. The same command in Illustrator works perfectly. I would appreciate any assistance on how to fix this headache. Reinstalling, pressing alt-ctr, goin

  • Clearing date problem

    hi all, this question is regarding clearing date of vendor's check run. They found out that one vendor from today's check run had a clearing date of 10/23/07 instead of 10/16/07. I checked and all the other payments from today's run had a 10/16/07 cl

  • Error in custom Web Service: DATREF_NOT_ASSIGNED

    I have created a new BO and Web Service. There is only one required element in the BO, but unless I make the Create call with all elements populated with a value, I get a DATREF_NOT_ASSIGNED error. Ideas?