8 Replies Latest reply on Nov 16, 2012 4:45 PM by W_J_T


    W_J_T Level 4

      Hello everyone, I have been trying to mess with and target "tints" via javascript but either I am not understanding something or it cant be targeted as I had hoped, so I am looking for direction and guidance. I have a spot color assigned in the color swatches palette, and have drawn a few boxes on the page using this spot swatch. I then try to alter the tint using JS code.


      sel[i].tint = // whatever number
      alert(sel[i].tint) // This alerts fine


      The alert shows a change taking place but it never gets applied to the item, the actual item never gets changed. I know things are properly targeted as I can change other attributes fine. When I look in the JS documentation it just shows for when creating a new spot, not for ones that already exist on items, I cant seem to find an example otherwise.


      What am I doing wrong here? Can tint be adjusted for items on the page that have a spot color applied?


      Thanks everyone for your time and input. ;-)

        • 1. Re: Tint
          CarlosCanto Adobe Community Professional & MVP

          Hi W_J_T, check this out, select your spot filled object first


          var idoc = app.activeDocument;
          var sel = idoc.selection;
          alert(sel[0].fillColor.tint) // This alerts fine
          sel[0].fillColor.tint = 25;
          alert(sel[0].fillColor.tint) // This alerts fine
          • 2. Re: Tint
            W_J_T Level 4

            Hi CarlosCanto,


            Thanks for responding, that works wonderfully. I still cant find that really referenced anywhere, maybe I am just reading the docs wrong, so confusing. I am really glad it was my own shortcoming and not that it couldn't be done, that's awesome! Thanks for the little example just what I needed, thank you so much CarlosCanto, wonderful!

            • 3. Re: Tint
              CarlosCanto Adobe Community Professional & MVP

              I know, the reference is confusing at first


              if you go the the SpotColor Object, you'll see it has 3 properties, one of them is "tint". So, any Spot Color Object would inherit this property.


              Any objects fillColor property returns a Color Object, if the object if filled with a spot color, the tint property will return its value, if the color typename property is other than spot (CMYK for example), "tint" will return "undefined" since other type of color objects don't have a tint property.

              1 person found this helpful
              • 4. Re: Tint
                W_J_T Level 4

                Thanks CarlosCanto for taking time to explain that further, that makes better sense for my understanding. It's hard to wrap my head around these things at times. The AI script docs seem a little lacking and maybe a little unintuitive to me on certain topics, but hopefully with time I can get a better grasp of them. Yourself and people like you along with searching this forum have been a great resource. Thanks so much for taking the time, really helpful stuff CarlosCanto.

                • 5. Re: Tint
                  W_J_T Level 4

                  Hi CarlosCanto, I had another inquiry on this topic. Is it possible if your selection is in fact a symbol instance to then therefore target fills inside the symbol to alter their tints? I cant seem to make sense of it, is it possible? Thanks so much in advance for your insight and assitance as always.


                  (Hmm... once a thread is marked correct or too old does it not move back up the current list? Unless a temp forum glitch? Hope my new inquiry will be seen?)

                  • 6. Re: Tint
                    Muppet Mark Level 5

                    I've overlooked questions before now presuming they are answered… If you have maked it so… then post a fresh subject that way you will get better responce me thinks… Don't cross post though it very quicly can get hard to follow where you at…

                    • 7. Re: Tint
                      CarlosCanto Adobe Community Professional & MVP

                      correct, once a thread has been marked correctly, it kinds of gets low priority, if I have only a couple of minutes I come and try to visit the unanswered questions first...sometimes I have more than a couple of minutes


                      now to your question, symbols can not be edited, you'll have to break the link, edit and make a new symbol

                      1 person found this helpful
                      • 8. Re: Tint
                        W_J_T Level 4

                        @Muppet Mark, good to see you around.


                        Hi Muppet Mark and CarlosCanto, thanks for each of your heads up concerning threads marked correct and their priority, I will keep that in mind going forward. I just thought it was still relative, sorry.

                        CarlosCanto wrote:


                        now to your question, symbols can not be edited, you'll have to break the link, edit and make a new symbol


                        Ugh... , I was afraid it was gonna be something like that. Thanks for the information CarlosCanto, much appreciated, thanks so much.