[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

Similar Messages

  • HT204161 Merge & Delete unused Apple IDs & Clear the 1 YR PW memory to use old PWs

    I keep getting a note for me to sign into a old Apple ID at "me.com" . I NEVER used this account as far as I know and was probably one that was used a long time ago to initially set up one of my computers.  I would like to see if there is anything important there but have NO idea what the password is since I have not actually signed onto it in years. I think maybe the cloud may think its a primary default account? I have really notice the issue since I have up dated my computer. I would like to DELETE it after I see if there is anything I dont want to loose. Better yet, Id rather merge it into the account I use now. Is there some way the Apple techs can see HOW MANY iCloud account I have hanging out there and if so can we merege and delete the ones I am not using?  Anther thing:
    IWhen I cannot always remember my password it always has me change it. I get blocked sometimes and just get frustrated and give up. It also tells me everytime I trty to put a new PW in of which I WILL be able to remember - that it has been used within the last 12 months. Can I have Apple reset that memory so I acan put PSs that I can actually remember? - Then there is the whole "Mail issue"- I have about 5 accounts for different purposes..but again sometime I have to change the PW...does the same crap- I thing the are ALL KINDS of settings  when yoiu change a PW so that the mail can coordinate wityh AOL, the Cloud, Gmail,and all my devices (iPhone. 2 Airbooks, my primary Desktop, my TVs, etc...etc.. Its all fristrating as ****!  Can you help me?
    I want to use 2 passwords ONLY for all these accounts...but like to clear that 1 yr memory thing that says PWs cannot be used..I wnd upo with so many different PWs I forget them all. Theere has to be a better way?

    I fixed the Daemon error so I did not need to migrate. Please delete all of this thread.

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

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

  • Gradient Swatch Tool does NOT work in CS3

    I made a gradient, named it, and filled a rectangle with it. I select the rectangle and fill it with the gradient. However, when I go to the gradient swatch tool, I'm unable to edit or change the gradient. The thing is, I can click on the gradient feather tool and make all kinds of changes to the gradient. HELP!!
    I have Windows XP, SP2 and Creative Suite 3 Design Premium. Also, I'm new to Indesign and installed the CS3 software approximately a month ago.
    Thanks!

    Thanks for the prompt replay! I guess I didn't explain myself well. I'm taking a class and the book specifies that after I fill my rectangle with the gradient I'm to select the rectangle, click on the gradient swatch tool, then place the mouse pointer on the top edge of the rectangle;click and hold shift, and then drag down to the bottom of the rectangle. When I release the mouse, the gradient is to change directions of the fill. The result should be kind of like going from a horizontal fill to a vertical fill.
    When I do it with the gradient swatch tool, nothing happens. BUT if I do it with the gradient feather tool, I don't have a problem with changing the outcome of the gradient. I just can't figure out why I can change the outcome with the feather tool but not with the gradient swatch tool???
    Thanks!

  • 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

  • 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

  • I know this is supposedly not possible, but I need to retrieve a specific voicemail from my iPhone which was also "cleared" from the Deleted Messages box. Any suggestions?

    I know this is supposedly not possible, but I need to retrieve a specific voicemail from my iPhone which was also "cleared" from the Deleted Messages box. Any suggestions?
    This is highly important. I know the number from which the voicemail arrived, but have not been able to figure out how to retrieve it. I accidentally had the voicemail in the Deleted Messages folder, and then Cleared this folder. If there is any possible way I might be able to retrieve this message, even if there is a cost associated with it, please help me.
    Thank you.

    I think you maybe able to restore from backup if that voicemail was included in the backup. http://support.apple.com/kb/HT1766

  • Please can someone explain how to retrieve deleted text, I was clearing old text when one came through at the same time so was also deleted.

    Can someone please tell me how to retrieve deleted text. i was clearing old texts when a new one came through at the same time and was deleted also.  My last update was  iOS 8.1.2

    You restore from a backup that was created after the text was received but before it was deleted.
    But if you literally deleted it right after it came in, then it's not recoverable.  Have the other person resend the text.

  • Making a white to clear gradient

    I'm used to photoshop and understand illustrator works on different principals, but I can't get a white to clear gradient or a gradient that has white on either end, or a graident in color..I've tried making a new gradient swatch like in InDesign and have tried loading various default graidents but can't get what I wNt I want to do this: thanks in advance.

    yes more simple but I'm losing the bright turq at bottom of button with only one rectangle. I need to understand the combining effects of the layering of images, how they affect one another. Am using the transparency palette to no avail.
    This is what I want, made from 2 separate gradient rectangles with an additional oval shape on top. (I took out the outside of the oval with Photoshop). I am unable to make a clipping mask that leaves all areas intact:
    This is how far I get, (below) and making a clipping mask either cuts out an area of the button I want, deletes one of the rectangles, which changes the gradation or "deletes" the whole image except for the bounding box(es), (Like in Post #11 above, image 5). I need to get rid of the areas with the red "X's". (I still think I'm thinking in terms of rasterizing software and can't get my head around Illustrator. I can do all I want in InDesign, but need to use Ai, so I don't understand what I don't understand!:
    In this last I tried simplifying the orig. elements, and made it from 1 rectangle that had a 3-color gradient (so I can keep the intensity of colors), but when I lay the top oval on, I don't get the look I want, regardless of transparency settings, arrangement of objects or if the oval is with/without a gradient...and still can't make a clipping mask anyway:
    Thinking outloud here!

  • Deleting unused master data

    Hi All,
    We want to delete unused master data. In our case, we need to delete material numbers from infoobject ZVD_MAT that is no longer used.
    There is standard SAP program RSDMD_DEL_BACKGROUND to perform this activity.
    But the problem is there is huge amount of data in ZVD_MAT and the above program will not give us any information of the material numbers that are deleted.
    By using this program, it might happen that new material numbers which are required are deleted. In this case, it will be difficult to refresh ZVD_MAT for those new material numbers.
    Can anyone suggest if there is any other way or programs/transactions to check the deleted materials?

    Hi,
    Try using the program
    RSDMDD_DELETE_BATCH
    Selective Deletion Using the Report
           1.      Enter report RSDMDD_DELETE_BATCH in ABAP Editor (transaction SE38) and create a variant for it.
           2.      Execute the variant.
           3.      Enter the InfoObject whose master data you want to delete.
           4.      In Filter Data, you can specify which data you want to delete.
           5.      You can specify a deletion mode for the data (parameter P_SMODE).
    More information: Deleting Attributes and Texts for a Characteristic
           6.      You can simulate the report before running it (parameter P_SIMUL).
           7.      You can schedule the report in the background. If you want to clear up your master data at regular intervals, you can also integrate the report into a process chain using process type ABAP Program
    or you can use function module as well
    Check if the function module RSDMD_DEL_MASTER_DATA
    Couple of import parameters:
    I_IOBJNM -
    Give info object name
    I_T_CHAVL---Characteristic values
    I_FLG_FORCE_DELETE-- to force delete
    Use I_FLG_SIMULATION to simulate first and then delete
    Thanks and regards
    Kiran

  • Backing up a "Delete Unused Media" Master.

    When we're finished editing a program on FCPro (latest version, with almost new computers) we'll go thru the Media Manager and use "Delete Unused Media" - and then save that (the folder and Sequence clapperboard)onto a DVD-R.
    Works great. And almost always restores perfectly.
    But sometimes, although we shoot on a CF Card (Canon XF300 camera and a Panasonic HVX200) the client will give us a Betacam tape, we need to capture from that - and of course Media Manager won't take "just a short clip" we use from that card. As I understand - it doesn't have the proper Time Code or something like that, not really relevant to my 'issue' here!
    But then the "Delete Unused Media" files can be 12 or more gig. so it needs several DVD-r's to write to. We use "BackUp" the Apple program that comes with Mobileme to do this as it seems to understand how to breakup a large file to multiple dvd-r's. Usually restores them just fine, too.
    But it can be a little flakey . . . it crashes more often than it should during this lengthy procedure. We'll get a BackUp Failed" error. When we click 'history' we see some vague (to us) like "An internal application error has occurred. The archive could not be created. End Backup at . . . "
    Doesn't help us much. We're using v 3.2 of BackUp. We'll have the same problem on a specific job with 3 different Mac's - so it's not "the" computer. Anyone have any experience with this . . . ?
    It does work most of the time, seemingly intermittent when it fails.
    Finally, maybe the easiest solution is to use some other program to backup to DVD'r's. Anyone know of any program that will backup large files (like Backup does) to multiple disks?
    Thanks very much,
    Larry

    Hi Meg,
    Thank you for your thoughtful response. BOY, did you open a can of worms around here! Either I just learned something VERY important from you that I didn't know (that I should know!), or perhaps you're mistaken in this particular instance ('cause I didn't make it clear in my original post - as it wasn't directly about THIS issue you've answered) - but in the back of my mind it IS a good issue - we'll see.
    I did not know that about the reel name! I believe you're saying as long as it has a reel name - the Unused Media "portion" of it will be deleted when I do a DUM. (Delete Unused Media!)
    OK - so we shoot on our Canon XF300 before I import it, I see it automatically names the Reel "Canon XF" and all the footage I shoot on the CF card - the DUM works perfectly. It also HAS a reel name!
    But then the client give us an old Betacam tape - and we capture the footage from that. Say it's a 30 minute tape. What I've found - and we're trying to figure out how to avoid - is if there is a 30 second scene on that 30 minute tape that we incorporate into the sequence - when I DUM the sequence - it will save the entire 30 minute tape! Even though we just want to use 30 seconds. That's how it works. Now I don't remember if we "name" that Betacam tape as a reel - we probably do, but I don't remember. But are you saying . . . that if the "capture" (whether from analogue tape or digital cards) has a REEL NAME - the DUM feature will work?
    I sure hope you're right - because so far - DUM works for us perfectly - EXCEPT when I include 'old' footage from Betacam or M2 tapes. Of course, that creates a very big file we're NOT wanting 95% of. So I think you're saying if we go back to the DUM sequence and "name" the beta tape - (if it isn't now) - then the DUM feature will work perfectly, as it does now on everythig else.
    Thank you Meg - this is important to us as it comes up all the time.
    Now pretend you're wrong and the Betacam footage DOES have a reel name. A workaround would be to take each clip we use from the Betacam tape and make a self contained movie of those few seconds, and use that on the timeline. But that would be really bulky. I'm really hoping you're right about the reel name. Have you had any experience with this?
    Really thanks, Larry

  • I have an iPad 2 and receive e-mail through internet connection. When I delete e-mails, and clear my Trash folder, they re-appear. Setting are for remove from server when moved from Inbox. Any idea what I can do to actually delete them?

    I have an iPad 2 and receive e-mail through regular internet connection. Lately, when I delete e-mails, and clear my Trash folder, they re-appear, downloaded anew from the server and marked as unread. My e-mail Advanced Settings are selected for "Remove from server when moved from Inbox." Even when I access the e-mail accountfrom my desktop and delete the e-mails, the re-appear on my iPad. Does anyone have any idea what is causing this and what I can do to actually delete them?

    Sounds like you are looking in the wrong Administrative Group container which is why you are seeing your Exchange 2010 servers in there.
    When you install Exchange 2003 only you will see a container named by default as "CN=First Administrative Group" container. But this could be named anything if you changed the Organization Name on the installation when you installed the first
    Exchange 2003 server into the domain/forest. 
    You will notice that when you install Exchange 2010 part of the AD setup is to create a new configuration container and is named by default "CN=First Administrative Group (FYDIBOHF23SPDLT)".
    So it sounds like you are not looking in the right location within ADSIEdit. 
    You may find the following article also helpful for this issue which is the same resolution:
    http://blogs.technet.com/b/sbs/archive/2012/05/17/empty-cn-servers-container-causing-issues-with-public-folders-on-small-business-server-2011.aspx
    I recommend though that you ensure your Exchange 2003 servers are fully uninstalled or no longer present in your environment before you go deleting the Servers container though.. The following Microsoft article will help with this:
    http://technet.microsoft.com/en-gb/library/gg576862(v=exchg.141).aspx

  • 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

Maybe you are looking for