Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to set aliasInkName to [No Alias]?

New Here ,
Mar 26, 2010 Mar 26, 2010

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

TOPICS
Scripting
911
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Mar 26, 2010 Mar 26, 2010

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
Translate
Engaged ,
Mar 26, 2010 Mar 26, 2010

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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2010 Mar 29, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 31, 2010 Mar 31, 2010

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.aliasInkName)

}

}

Shonky
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 31, 2010 Mar 31, 2010
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines