4 Replies Latest reply on Mar 31, 2010 6:42 AM by gd380

    How to set aliasInkName to [No Alias]?

    gd380

      Greetings,

       

      So I have no problem using javascript to set an ink alias:

       

      myInk.aliasInkName = "myInkAliasColor";

       

      Works wonderfully.

       

      But how do I remove the alias?

       

      I've tried:

       

      myInk.aliasInkName = null;

      myInk.aliasInkName = "";

      myInk.aliasInkName = "[No Alias]";

       

      and several others.

       

      Help!

       

      Thank you!

       

      --Greg

        • 1. Re: How to set aliasInkName to [No Alias]?
          Shonkyin Level 3

          Hi Greg,

           

          Check this one

           

          //make and new spot colors "test1" and "test2" and run below code:

          app.activeDocument.inks[4].aliasInkName = "test2"//inks[0]-inks[3] for CMYK

          alert (app.activeDocument.inks[4].aliasInkName)

          app.activeDocument.inks[4].aliasInkName = "[No Alias]"

          alert (app.activeDocument.inks[4].aliasInkName)

          Shonky
          • 2. Re: How to set aliasInkName to [No Alias]?
            gd380 Level 1

            Thanks, Shonky. That worked.

             

            I thought I tried that. Apparently I was mistaken.

             

            But I have another question: how do you test to see if a color is aliased?

             

            Neither of these seem to work:

             

                           if (tempInk.aliasInkName == "[No Alias]")
                                tempInk.aliasInkName = "test1";
                            else if (tempInk.aliasInkName == "[NoAlias]")
                                tempInk.aliasInkName = "test1";

             

            Just curious - I don't actually need to do this and I can't think of a business case where I would need to.

             

            --Greg

            • 3. Re: How to set aliasInkName to [No Alias]?
              Shonkyin Level 3

              With below code you can check alias setting.

               

               

              var inklength = app.activeDocument.inks.length

              if (inklength>3)

              {

              //starting from 5th color becuase you cannot set ink alias on first four

              for (a=4; a<inklength;a++)

              {

              alert (app.activeDocument.inks[a].aliasInkName)

              }

              }

              Shonky
              • 4. Re: How to set aliasInkName to [No Alias]?
                gd380 Level 1

                Thanks, Shony.

                 

                I was trying to get it to work in the context of an if statement, but testing for "[No Alias]" and others didn't seem to work.

                 

                --Greg