Skip to main content
This topic has been closed for replies.
Correct answer Kukurykus

There's no Domestic Oriented Model method for this, so you are limited to write own Action Manager function that after all would be source for future DOM way to get the same. You can only write it more readable (whatever you consider for that):

function color(color) {

     function sTT(v) {return stringIDToTypeID(v)}

     (ref1 = new ActionReference()).putEnumerated

     (sTT('layer'), sTT('ordinal'), sTT('targetEnum'));

     (dsc1 = new ActionDescriptor()).putReference(sTT('null'), ref1);

     (dsc2 = new ActionDescriptor()).putEnumerated(c = sTT('color'), c, sTT(color))

     dsc1.putObject(sTT('to'), sTT('layer'), dsc2), executeAction(sTT('set'), dsc1)

}

color({1:'none', 2:'red', 3:'orange', 4:'yellowColor', 5:'green', 6:'blue', 7:'violet', 8:'gray'}[7])

1 reply

Kukurykus
KukurykusCorrect answer
Legend
July 23, 2018

There's no Domestic Oriented Model method for this, so you are limited to write own Action Manager function that after all would be source for future DOM way to get the same. You can only write it more readable (whatever you consider for that):

function color(color) {

     function sTT(v) {return stringIDToTypeID(v)}

     (ref1 = new ActionReference()).putEnumerated

     (sTT('layer'), sTT('ordinal'), sTT('targetEnum'));

     (dsc1 = new ActionDescriptor()).putReference(sTT('null'), ref1);

     (dsc2 = new ActionDescriptor()).putEnumerated(c = sTT('color'), c, sTT(color))

     dsc1.putObject(sTT('to'), sTT('layer'), dsc2), executeAction(sTT('set'), dsc1)

}

color({1:'none', 2:'red', 3:'orange', 4:'yellowColor', 5:'green', 6:'blue', 7:'violet', 8:'gray'}[7])

leeroldyAuthor
Participant
July 23, 2018

Thank you. I guess that explains the lack of results for my searches on the internet. Illustrator had a "logical" readable way of doing this and I thought that would work but alas it didn't. Oh well.