TRUE Contract command: Listener > DOM

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Paul MR

TRUE Contract command: Listener > DOM

Post by Paul MR »

Why it works with the try catch is a mystery?
Oh I forgot an important line...
Code: Select alltry{
var chanRef = activeDocument.channels.add();
chanRef.kind = ChannelType.MASKEDAREA;
chanRef.name = "Temp 1";
activeDocument.selection.store(activeDocument.channels["Temp 1"], SelectionType.REPLACE);
}catch(e){}

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Klaatu Baradda Nikto

TRUE Contract command: Listener > DOM

Post by Klaatu Baradda Nikto »

Oh snap! Perfect!

Interesting about the try/catch mystery. An undocumented feature, no doubt.
Mike Hale

TRUE Contract command: Listener > DOM

Post by Mike Hale »

That is strange. It works for me without the try/catch.

On my system setting the channel kind results in an inverted mask.

As you already have a reference to channel couldn't you use

Code: Select allactiveDocument.selection.store(chanRef, SelectionType.REPLACE);
Klaatu Baradda Nikto

TRUE Contract command: Listener > DOM

Post by Klaatu Baradda Nikto »

Now, this is interesting. Removing the try/catch on this corrected version worked like Mike says. Hmmm... I think I have a headache now. LOL!

Thanks to both you guys. You are amazing.