Copy link to clipboard
Copied
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
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)
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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)
}
}
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now