Deleting Unused Swatches

Because I'm unable to invoke the "Select All Unused" menu item of the Swatches panel menu I'm trying to attack it programmatically.
What I'm trying to determine is if it's sufficient to compare the Fill and Stroke Color of each Path Item (every path item of current document) or are there other items that should be examined to achieve the same results as the command in the Swatches panel menu? Page Items doesn't appear to contain a Fill Color property. I've got AppleScript code that appears to do the trick, but I'd like to get input so as to make sure I'm not missing something that my testing might not have uncovered.
Thanks!
Stephan

Another method might be to remove the extra swatches from the startup files (or New Document Profiles as they are now known) So there are fewer unused swatches to deal with. Relatively few people take the time to modify the action sets aside from adding new ones. Here's how the Delete Unused Panel Items looks in the Default _Actions.aia file
/action-10 {
    /name (Delete Unused Panel Items)
    /keyIndex 0
    /colorIndex 0
    /isOpen 0
    /eventCount 8
    /event-1 {
        /internalName (ai_plugin_symbol_palette)
        /localizedName (Symbols)
        /isOpen 0
        /isOn 1
        /hasDialog 0
        /parameterCount 1
        /parameter-1 {
            /key 1835363957
            /showInPalette -1
            /type (enumerated)
            /name (Select All Unused)
            /value 12
    /event-2 {
        /internalName (ai_plugin_symbol_palette)
        /localizedName (Symbols)
        /isOpen 0
        /isOn 1
        /hasDialog 1
        /showDialog 0
        /parameterCount 1
        /parameter-1 {
            /key 1835363957
            /showInPalette -1
            /type (enumerated)
            /name (Delete Symbol)
            /value 5
    /event-3 {
        /internalName (ai_plugin_styles)
        /localizedName (Graphic Styles)
        /isOpen 0
        /isOn 1
        /hasDialog 0
        /parameterCount 1
        /parameter-1 {
            /key 1835363957
            /showInPalette 1
            /type (enumerated)
            /name (Select All Unused)
            /value 14
    /event-4 {
        /internalName (ai_plugin_styles)
        /localizedName (Graphic Styles)
        /isOpen 0
        /isOn 1
        /hasDialog 1
        /showDialog 0
        /parameterCount 1
        /parameter-1 {
            /key 1835363957
            /showInPalette 1
            /type (enumerated)
            /name (Delete Style)
            /value 3
    /event-5 {
        /internalName (ai_plugin_brush)
        /localizedName (Brush)
        /isOpen 0
        /isOn 1
        /hasDialog 0
        /parameterCount 1
        /parameter-1 {
            /key 1835363957
            /showInPalette 1
            /type (enumerated)
            /name (Select All Unused)
            /value 8
    /event-6 {
        /internalName (ai_plugin_brush)
        /localizedName (Brush)
        /isOpen 0
        /isOn 1
        /hasDialog 1
        /showDialog 0
        /parameterCount 1
        /parameter-1 {
            /key 1835363957
            /showInPalette 1
            /type (enumerated)
            /name (Delete Brush)
            /value 3
    /event-7 {
        /internalName (ai_plugin_swatches)
        /localizedName (Swatches)
        /isOpen 0
        /isOn 1
        /hasDialog 0
        /parameterCount 1
        /parameter-1 {
            /key 1835363957
            /showInPalette 1
            /type (enumerated)
            /name (Select All Unused)
            /value 11
    /event-8 {
        /internalName (ai_plugin_swatches)
        /localizedName (Swatches)
        /isOpen 0
        /isOn 1
        /hasDialog 1
        /showDialog 0
        /parameterCount 1
        /parameter-1 {
            /key 1835363957
            /showInPalette 1
            /type (enumerated)
            /name (Delete Swatch)
            /value 3

Similar Messages

  • 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();

  • Deleting unused swatches except for...

    I have a script that cleans up my document... one of the functions is that it deletes unapplied swatches. This works well for me most of the time but in instances where I'm using a color whose name begins with a "D", I want the script to ignore it.
    In my workflow, "D" represents a digital process and we don't apply a color swatch to digitally printed artwork but a "D" swatch is necessary for our output program to sort the job to the correct printer. The swatch names vary but always begin with a "D" (DBLK, DGLD, DGRN....).
    Thoughts, suggestions?
    Thank you very much for your help.
    //delete unused swatches
    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();
    (I found this little script somewhere in these forums - I apologize for not having the credit information available)

    Hi,
    replace the line:
    if (name != ""){
    with:
    if (name != "" && name.search(/^D/) == -1){
    ...(/^D/i) if not case sensitive...
    Jarek

  • 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();

  • Need help deleting unused swatches in CS4

    I upgraded from CS3 to CS4, and simultaneously switched platforms from windows to mac osx. Now I can't find the option for deleting all unused swatches in the swatch palette menu and I'm starting to feel insane because I've run several searches and no information about this is popping up anywhere. Can anyone help?

    That's one way, I guess. But in CS3 I was able to select all unused swatches and then drag them to the trash. That way I could still have my default swatches for new projects. But I guess this feature was removed for CS4?

  • [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

  • Utility to collect/delete unused links?

    [INDD CC]  I inherited a very long do and have to update all links. Is there a way to collect and delete all unused links from the links palette and the links folder once they've been replaced? Kind of like how the swatch palette has a "select all unused" swatches and you can delete them?
    thnx ~~carol

    I must have read that one too quickly, because I didn't notice that he said "links palette." I thought he was only talking about unused links in a folder. If there are extra items in the links panel, they could be on the pasteboard, but there is a page indicator in the window, so I'm guessing he didn't miss that. May be they are hidden objects (try Object>Show All On Spread) or on a hidden layer (check the layers panel). If they are on the pasteboard but you can't see them, they could have been pushed nearly off the edge. If you select all and deselect the visible items with the shift key, you will see the frame handles of anything that is mostly off of the pasteboard and into never-never land.

  • Action to remove all unused swatches nearly works...

    I've been using the default Action to remove fluff (unused swatches, symbols, brushes, etc.) but it has a funny quirk. I have a spot black color (named black) that always escapes the purge, even if it not used in the document. It is not set as the default stroke/fill, and there are no styles that use this swatch. Even if I run the Action twice the swatch remains. Even if I rename the swatch to something other than black it remains. Even if I rename the swatch and give it a different CMYK mix it remains. As a kludge, I've been using a combo of the default action and John Wundes' Delete Fluff script to get everything, but it is not an ideal solution. Wundes' script, which is unable to delete used brushes, roots out the offending swatch. It is unable to delete unused brushes, so following up with the default action clears those out. Also, Wundes' script is very slow and will often beach-ball the application, requiring a force-quit occasionally.
    Two questions:
    ============
    Can anyone think of other places that might harbor this rogue spot color and make the default action not find/delete it?
    Is there a simple script that could check specifically for the use of this color in the document and delete it?
    Cheers and thanks!!
    -G-

    The reason I feel like it is a remnant of a deleted brush is because:
    -- I can run the Action the first time and the unwanted swatch is still there.
    -- I can run the Action again (or ten times), and it is still there.
    -- If, however, I save, close, and then open the document, and run the Action again then it will result in getting rid of the unwanted swatch.
    I don't know what magic exists in John's script, but it has no problem getting rid of the unused swatch right off the bat...
    -g-

  • Is there a button to remove all unused swatches in a file?

    Hey all, 
    Just wondering is there a button that removes all unused swatches in an illustrator file?
    Any help would be great

    Look in the Actions panel. There should be an action there which says Delete All Unused Panel Items.

  • • INDD crash when select "all unused swatches"

    Hello -
    I think all is in the topic title…
    My InDesign® CS5 (7.0.4) crash when I select "all unused swatches" (from swatches palette).
    This happens in opened document, but also in a new empty document.
    • I delete (an rebuild) the préférences of the software.
    • I repaired the authorizations of the Mac
    Does someone know why?
    Thank you, have a nice day…
    - Dimitri
    [link removed by moderator]

    Hello Peter -
    Thank you for your answer.
    But I didn't trash manually the prefs. files.
    I did it via the keyboard keys combination (when InDesign® is launched).
    So is there another trick?
    Thank you, have a nice day…
    - Dimitri

  • 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".

Maybe you are looking for

  • Mac doesn't recognize iphone

    I went to update some music on my iPhone 3G on my Mac Book Pro and absolutely nothing happened. It didn't even recognize that the phone was connected to charge it. Suggestions? Thanks in advance.

  • P7-1446s Hooking up a Audio-Technica AT-LP120- USB Turn Table Windows 8 64bit

    When I plug the USB cable from my Audio -Technica AT-LP120 USB turn table into my HP p7-1446s,  I loose sound from anything else such as iTunes. The computer recognizes the turn table, it shows up as a "3-USB Audio CODec Default Communication Device"

  • Can't find AIRes.dll when updating AI CS6 to 16.0.5

    I get the following message when I try to update AI CS6 ver. 16.0.3 to 16.0.5: "Can't find AIRes.dll. Please re-install the application" I uninsatlled and reinstalled and changed permission to admin. Restarted computer and still get message. Win 8.1

  • Errors creating recovery disk

    I have received error 020150-20-00000000 twice when attempting to create the recovery disks.  It has happened on the first disk with two different files when trying to verify.. I have a Satelite L505D-LS5010 with win 7 Thanks Frank

  • Copy class of a Functional Location

    Hi All, I have to copy the class and characteristics of one functional location to another. Found a function module PM_COPY_SUBOBJECTS but this only copies the class but not the characteristics. Kindly suggest a function module or BAPI or any method