5 Replies Latest reply on Jun 4, 2012 10:03 AM by rob day

    Pasting objects creates new color swatches

    TomBerglie

      Hi!

       

      I have a problem when copying and pasting objects that use color swatches between InDesign documents, it goes like this:

       

      I copy an object using the color swatch "My Color" from one document, and paste it into a different document that alredy contains a swatch with the same name.

       

      If the swatch "My Color" in the receiving document has the same color values as the copied object, everything works as expected.

       

      But if the "My Color" swatch of the receiving document has different color values, the pasted object retains its color, and a new swatch named "My Color 2" is created, and it contains the color values of the pasted object. What I would want is for the pasted object to change colors to reflect the color values in "My Color" of the receiving document.

       

      Is there a way to make InDesign work like I want it to? (That is, similar to the behavior of Paragraph styles when text is pasted between documents?)

       

      A funny thing is, if I create a snippet of the object instead of copying and pasting it, the colors behave as expected when I place that snippet. The receiving document recolors the object, and no new swatches are created. Unfortunately, in this particular work flow, creating snippets is not an option.

       

      I am currently using InDesign CS5,5 on a Windows 7 system, but I am experiencing the same behavior in both Mac OS system and on my InDesign CS6 System.

       

      Best regards,

      Tom

       

      (Ps. A work around using Merge Colors after pasting would be too tedious for this kind of work flow.)

        • 1. Re: Pasting objects creates new color swatches
          Peter Spier Most Valuable Participant (Moderator)

          As far as I know, that's the way it works when you paste. You don't have to deal with it after each paste operation, though, unless you want to. The easiest method I can think of is simply to select the unwanted swatch copies and delete them, picking the original from the list when ID asks what to use instead.

          • 2. Re: Pasting objects creates new color swatches
            TomBerglie Level 1

            Hi Peter, and thanks! That method would yield the same results as the Merge Color thing, and would require about the same amount of manual action.

             

            I am aiming for a work flow as automated as possible here. ;-) An option (in Preferences, perhaps?) to have Color Swatches behave the same way as Styles when copied between documents would possibly have solved this particular problem.

             

            Tom

            • 3. Re: Pasting objects creates new color swatches
              rob day Adobe Community Professional & MVP

              It is scriptable. This AppleScript would work with OSX. It's pretty simple so maybe someone can translate it to JavaScript for your Windows 7 machine.

               

              Attach the script to a key command and run it instead of Paste:

               

               

              tell application "Adobe InDesign CS5.5"

                        set myDoc to active document

               

                --get the list of document swatches before the paste

                        set currentColors to name of every swatch of myDoc

               

                paste

               

                --get a new list which would include duplicates

                        set newColors to name of every swatch of myDoc

               

                --find the duplicates and merge with the original

                        repeat with i from 1 to number of items in newColors

                                       set c to item i of newColors

                     --the duplicate has a space + 2 added to its name so get its name minus 2 characters

                                       if c is not in currentColors then

                                                      set mergename to characters 1 thru ((count of characters of c) - 2) of c as string

                          --merge with the original swatch

                          merge swatch mergename of myDoc with swatch c of myDoc

                                       end if

                        end repeat

              end tell


              • 4. Re: Pasting objects creates new color swatches
                TomBerglie Level 1

                That is awsome, Rob, thanks! I'm going to test it on the Mac shortly and I would surely like to see a JavScript version. It's still a workaround though, but I'm going to see if I in some way can automate this.

                 

                I sure appreciate your effort!

                 

                Tom

                • 5. Re: Pasting objects creates new color swatches
                  rob day Adobe Community Professional & MVP

                  You should be able to set the Command-V key command to the script and override the default paste, then the destination swatches would always be used. Obviously the color values of the source swatch will always be changed—if that matters?.

                   

                  If you want it to work for Paste Into or Paste in Place you'll need to make separate versions and replace the paste command with paste into or paste in place (all lowercase)