[JS CS5] Deleting unused colours

Hi,
I have a document with over 3000 colours.
Most of them are unused, a few are swatches.
I thought to add all unnamed colours to swatches and then to delete all colours without a name but I do not know how to do the first step.
Unfortunately I have a "document.unusedSwatches" but not a "document.unusedColours".
Is there any other way to know if a colour is used or not within a document?
Thanks.

Working with colors I found that everytime you create a color (with the color panel) InDesign instance a color object with no name, even if you are applying it directly to an object. The same happens if you play with color sliders: everytime you change something form the color palette a new color object is created. Weird I know, but that's how InDesign works. Try it yourself: create a new document, open the color panel and randomly change color values playing with color palette sliders: if you count colors objects (app.activeDocument.colors.length) you'll see that the amount of colors increase everytime you change something in color palette. Colors are basically a swatch subclass, and the only thing that matter is the fact they don't have a name. So you can have colors (with no name) that are not swatches but are correctly applied to objects. When you select "add unnamed colors" (I'm translating it from italian...) from swatches palette you basically give a name to applied colors and transform them in swatches.
Here comes my problem: I need to add used "colors" in swatches palette in order to make them become "swatches" and then delete all unused "colors" because I need to get rid of all unused colors, not only swatches.
I can manually add unnamed colors to the swatch palette, but it looks like it's not that simple by script.
Sorry for my english, hope evreything was clear enough.
Ciao.

Similar Messages

  • Delete unused swatches in InDesign CS5, js

    Hi,
    I need to select and delete unused swatches in InDesign CS5. I looked through OMV in "Swatches" and "Swatch", but I could not find any function to select unused swatch and delete it.
    Am I looking for it in the wrong place?
    And I also need to read color values for used swatches. I got this in OMV and was hoping it would give me an array of the color values for all existing swatches, but I am only getting "Object color":
    mySwatches = myDoc.swatches[1].getElements();
    alert (mySwatches)
    Thank you for your help.
    Yulia

    Hi Yuliaart,
    Try this script it will help ful.
    # target "Deleting unused swatches change the gradient"
    var myIndesignDoc = app.activeDocument;
    var myUnusedSwatches = myIndesignDoc.unusedSwatches;
    for (var s = myUnusedSwatches.length-1; s >= 0; s--) {
         var mySwatch = myIndesignDoc.unusedSwatches[s];
         var name = mySwatch.name;
    // alert (name);
      if (name != ""){
    mySwatch.remove();

  • Deleting unused hyperlink destinations

    Is there a quick way of identifying then deleting unused hyperlink destinations? I have a large document with hundreds of links which are constantly being changed and updated. Is there a way I can automatically select unused destinations and delete them (in the same way as you might do in a colour or styles palette for example). It's not essential but it would be good housekeeping! InDesign 5.0.3

    control/delete (asks...are you sure??) deletes the files of the drive. just hitting delete, them takes them off the audio file list.

  • [CS3][VBS] Delete Unused Swatches ALSO clears Gradient Swatches!

    Hi Folks!
    Heres another weird one. This code deletes unused CMYK swatches properly but also sets the background of some gradient swatches to black.
    myUnusedSwatches = currentdoc.UnusedSwatches.Count
    For myLoop = 1 To myUnusedSwatches
    On Error Resume Next
    Set myUnusedSwatches = currentdoc.UnusedSwatches.Item(1)
    *** I even through this in as a last ditch solution, but it only works sometimes***
    if instr(lcase(currentdoc.unusedswatches.item(1).name), "gradient") = 0 then
    myUnusedSwatches.Delete
    else myUnusedSwatches.Save
    end if
    Next
    Any ideas?

    I think i've gotten to the bottom of this - the designers have been using 'Paper' as a white background for gradients. When a colour swatch with CMYK 0 is used, the script works.
    If TypeName(currentdoc.UnusedSwatches.Item(1)) = "Gradient" Then
    Doesn't work, unfortunately, because its not actually deleting the gradient, its setting its background colour to black; the unused swatch its deleting is actually a color swatch.
    Since there will be a lot of files here set up this way, can you think of any way to work around this? Why does this not happen when you do the same action in the UI ('select all unsused'> 'Delete')?
    Thanks again Ole!
    Adam

  • How to delete unused audio files in a project?

    Hi guys,
    The question is fairly simple:
    How to delete unused audio files in a project?
    I can't manage to find the answer in the manual,... all I could find is how to delete audio outside used regions!
    But in the projects I use, I have loads of outtakes which I don't use in the project anymore, and now, I would like to delete them of the audio folder to save space on the HD.
    Can Logic select automatically the takes in the audio files folder which are not used in the project and delete them??
    Because there is hundreds of audio files per project, and +/- 50 projects, I just can't do it manually.
    Thanks,
    Fred

    Whoops! Yes, I knew that but a cow flew by... Sorry!
    The procedure I follow is to do what I described then Save as Project, creating a project folder. That way only the required audio is saved to the folder and I delete all temporary stuff. However, if you have folders with shared material, it's much harder and would require you to go through all your projects doing Save as Project before you could delete your old working folder.
    When doing day to day work, best practice is to create a new folder and only use Save as Project when you're working on stuff. Shared material (eg sample libraries etc) can go elsewhere and you can get Logic to copy those to the project folder automatically.
    Otherwise, Shift-Backspace in the Audio window, as you rightly say
    Pete

  • Why can I no longer add photos my iPhoto book? Is there a limit to the number of photos? Must I delete unused photos??

    Why can I no longer add photos my iPhoto book? Is there a limit to the number of photos? Must I delete unused photos?

    This is book # 13 and I've not encountered this problem before. I am dragging photos into the sourse pane but they are not imported. I have other books w/ over 700  pics (not all used) but this has only 300+ so far. I've copied the book to a pdf and it looks as if I'll have to redo it unless there's another solution.

  • HOW TO Delete Unused Media from FINAL CUT PRO

    *HOW TO DELETE UNUSED MEDIA FROM HARD DRIVE IN FINAL CUT PRO.* Keywords: disk disc drive space remove compressor
    SUMMARY:
    Say your original clip is 10 gigs, you can use only what you need and delete the rest from your hard drive. I know people on the forums say to just buy another hard drive, NO! It took 2 days to figure out but here it is!!! Email me if needed at [email protected]
    QUESTION:
    I captured 1 hour of video at a time and now want to delete from my hard drive all the parts I don’t want to use. I have 300GB of junk on my hard drive and I only want to use a few scenes using a few megabytes, so that I'll get most of my 300GB back!!!!
    ANSWER:
    In final cut on Mac, click on one small clip (to get familiar with process), go to “file”, “export”, then “using compressor”. This will open compressor software. Your file will open in the left top window. Then you need to batch the job or jobs. IMPORTANT: I’ve also solved the Compressor problem when you press “submit” to a batch and it states “Cluster: None”. Search forum for “In compressor you experience what I have”.
    <Edited by Moderator>

    Part of the problem could lie in the fact it's an imovie project coming into FCP, wouldn't rule that out. Second my be the terms you use and what you expect to happen. For example, a subclip is just a smaller clip subbed from a larger clip. It has nothing to do with media management. But you can media manage a subclip and delete the unused media.
    Try this (be sure to back up the original clip first). take a long clip into the viewer, make an IN and OUT duration of like 30 frames and then subclip that, Modify > Make Subclip. a new subclip will appear in the browser with a torn clip icon and the name Subclip. Right click on the subclip and choose Media Manager.... Check the Delete unused media from duplicated clip. As you toggle that the green Modified bar at the top change from the full clip size to a tiny modified size. If it does not then one of two things ... user error or the system is screwed up. That's the easiest way to test media manager.

  • Deleting unused media in Media Manager not working

    This is one of those cases where I get really frustrated with Apple...
    I've captured some footage from VHS using 'capture now', and the media that was created has a bunch of blank frames at the beginning and end. I'd like to remove the excess media from the clip to save space.
    I'm following the directions EXACTLY as shown in the section "Creating Independent Media Files From Subclips After Capturing" from the Final Cut Pro User Manual on page 377 selecting subclips I want to keep and using Media Manager to delete unused media, but my media hasn't gotten any smaller, and the blank frames in the original media are still there if I reconnect it.
    Furthermore, I've tried using media manager to copy the referenced media (from a subclip) to a new clip, and it just copies the whole file.
    How can I get rid of this excess waste of space!!?

    Well, does this footage have timecode? A REEL number? If you captured as NON-CONTROLLED device the footage might not have timecode, and without timecode the Media Manager cannot track exactly what you want to remove...what footage you want set aside and copied as the rest is deleted. This is also the case if you don't have a reel number. You might have 5 clips all with the same starting timecode but no reel number.
    Shane

  • Deleting unused footage in the Event library?

    I always make an edit of my videos and therefore end up with a fair amount of footage in each event which is not needed any more.
    Is there a way of deleting unused footage from a specific project from it's event?

    Use the Reject Tool to drag with your mouse over the frames you don't need. They will be marked with a red bar underneath. If you want to reject a whole clip, you can right-click and reject the clip that way too.
    Then, select "Rejected Clips Only" in the selection box at the bottom.
    Finally, click "move rejected clips to trash".

  • How do I invert a selection in iMovie 11/ delete unused portions of clips

    I want to delete unused portions of clips:
    In iMovie 11 an orange bar appears at the bottom of a clip to show that that portion of the clip is being used in a project.
    If I click on the orange bar, the yellow clip selection extends to that portion of the clip.
    I want to invert the selection so that the portion of the clip that is not used is selected so that I can reject it and later delete unused portions.
    If there is another way to do that then great...
    Thanks
    David

    I think it might be easier to first finish the project with all that extra video clip lying around and then use the Space Saver to tidy things up. It's under the File Menu and is always done at the very end when you have already Finalized your project.
    From the iMovie Help:
    In the Event Library, select one or more Events.
    To select more than one Event at a time, press Command as you click Event names.
    Choose File > Space Saver.
    The File menu appears in a light gray bar across the top of your computer screen.
    Select any of the following:
    To reject all of the video that hasn’t been added to an iMovie project, select “Not added to any project.”
    To reject all of the video that you haven’t marked as “favorite,” select “Not marked as Favorite.”
    To reject all of the video that you haven’t marked with a keyword, select “Not marked with a keyword.”
    Click “Reject and Review.”The view changes to show only the rejected clips in the selected Events.
    *Note: This is not the full listing of Help for the Space Saver function but you get the idea. It seems as though Apple thinks it's a much better use of your time to put off the house keeping tasks like cleaning up unused video until after you have Finalized the project.

  • Media Manager not deleting unused media from HDV (intermediate codec) clips

    I have a project which uses HDV footage which I captured using the Apple Intermediate Codec. I now have a bunch of clips that are very large in file size so I'd like to use the Media Manager to delete all the unused footage from the clips. I have tried countless different selections of sequences, clips in the browser, clips in a timeline etc but can't seem to get the Media Manager to show a smaller file size for the processed files based on 'Use Existing' with 'Delete unused media' option. The two size meters at the top always stay the same. Can the media manager trim HDV/Apple Intermediate Codec footage? If not is there a way to get rid of the footage that I haven't used? Thanks!
    Ben

    I've never mastered MM. If I want a small section out of larger clip, I simply just export that section of the clip using 'current settings'.
    Hope someone who has tamed the MM beast will step in here and offer you a better way...
    good luck.
    x

  • Delete unused footage in iMovie 10.0.6

    I have used previous versions of iMovie and found that I was able to delete any unused footage in a clip.  For example you had a video clip that was 2 minutes long, but you only used a 10 second snip of it in a project you could delete the remaining 1 minute and 50 seconds which was great in clearing your hard drive. I was able to do this by selecting a folder then holding down command and delete buttons, delete unused footage. In iMovie 10.0.6 I can't seem to be able to do this or find a simular feature.  Any ideas?

    Hello Yanuar Tourniquet,
    Welcome to the Apple Support Communities! The new iMovie interface includes a few video effects that may achieve what you want. For information on how to apply these effects to your clips, check out the following resource:
    Add video and audio effects - iMovie Help
    http://help.apple.com/imovie/mac/10.0.6/#/movd17f56aaa
    Add a video effect to a clip
    1. In the browser or the timeline, select a clip or range.
    2. To show the effects controls, click the Video and Audio Effects button.
    3. Click the Video Effect button, and then click the video effect you want to apply to the clip.
    To remove a video effect, select the clip or range containing the effect, click the Video Effect button, and click None.
    Cheers,
    Matt M.

  • How can we fine and delete unused variables?

    Hi , This is Kumar,
    I have been working for some Upgrade project. My manager asked me the way  to know unused variables which are already declared in the program . But i don't know any special way to find them.
    Normally for Internal tables we are using CLEAR, REFRESH AND FREE.
    So,
    How can we delete unused variables which are already declared in  program?
    If anybody have any idea , kindly let me know.
    Thanks & Regards,
    P.N.Kumar.

    Hello friend,
    in SE24,SE38 and SE80 there is a menu called "Refactoring" which can enable you to delete unused variable defined in your source code automatically.
    Of course it is not the only functionality of this poweful tool. Please read the article below:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/2054857b-1b4d-2c10-f7a5-d283a11f6789
    I am sure you can benefit a lot from it not only know how to delete unused variable
    Best Regards,
    Jerry

  • What can be done to avoid getting the following error when trying to delete unused clips he operation could not be completed.  *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil

    what can be done to avoid getting the following error when trying to delete unused clips in Imovie 09 "the operation could not be completed.  *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil"  I use to get these type of error messages when trying to delete unsused clips from a large event 60 minutes or longer, but now I get this message when trying to reduce a 4 minute event.
    Also, does anyone know if there is a limit to the total amount of space that can be taken up by Projects in Imovie 09
    Thanks for any help

    Zachy,
    It goes something like this...
    Put your new drive in the enclosure. Use Disk Utility to format it, etc. I'd give it a slightly different name than the original. Let's say you have Old Disk and New Disk as your drive names. Use Carbon Copy Cloner to copy Old Disk to New Disk. Now you should have an exact copy, which you can test by rebooting and holding down the Option key. Choose New Disk from the list and let it boot, make sure all is well.
    Shut down and physically swap the drives. Take Old Disk and put it in the enclosure. Now your system has a new disk with a lot more space and you can reformat your old disk and just use it for large files or whatever.

  • Deleting unused swatches change the gradient

    Hi All,
    I have tried this Javascript to remove unused swatches in a document (Indesign CS4). It did remove all the unused swatches but it changed the used gradient color into black color and still has the gradient property but couldn't change any color values for that particular gradient after running the script.
    #target indesign
    var myIndesignDoc = app.activeDocument;
    var myUnusedSwatches = myIndesignDoc.unusedSwatches;
    for (var j=myIndesignDoc.unusedSwatches.length; j > 0; j--)
      myIndesignDoc.unusedSwatches[j-1].remove();
    Please advise me where I did wrong and also please suggest the right solution for this.

    Hi Friends
    Use this script it will help ful.
    # target "Deleting unused swatches change the gradient"
    var myIndesignDoc = app.activeDocument;
    var myUnusedSwatches = myIndesignDoc.unusedSwatches;
    for (var s = myUnusedSwatches.length-1; s >= 0; s--) {
         var mySwatch = myIndesignDoc.unusedSwatches[s];
         var name = mySwatch.name;
    // alert (name);
      if (name != ""){
    mySwatch.remove();

Maybe you are looking for