Copy link to clipboard
Copied
I have a channel named test
if the channel exists a warning must say ok
if the channel does not exist a warning that says ko.
try { app.activeDocument.channels["test"]; alert("ok"); } catch(e) { alert("ko"); }
Copy link to clipboard
Copied
And what exactly are you asking? A script? An action? How is it supposed to be used? You need to be much more specific and provide a proper explanation instead of vomitting bullet points.
Mylenium
Copy link to clipboard
Copied
This is taken out of context. Unfortunately not first time.
Copy link to clipboard
Copied
r-bin
You are always the best.
Kukurykus
True, I'm not always specific in asking questions
the point is this;
how come r-bin always understands me and you never understand me?
Copy link to clipboard
Copied
To let others understand what you want you should describe situation like for ex.: "I have an open document, I run the script and then I want to get to know if in document the channel named "test" exists or not".
Without above it's unclear what you want, because checking named channel is so simple & obvious task in scripting that taking in consideration a long time you attend on this forum it is unbelivable you may ask about such basic stuff, like:
"If document is open then alert says 'open', if not, then 'not open'", really?
alert(!documents.length ? 'closed' : 'open')
Now you understand I don't get you might want common and after all searchable thing on this forum. That doesn't need to create new topic. So what I looked for was the situation, the named channel was part of, not solely how to check 'if the hole is for door or window'.
Regarding r-bin, probably he learned after years your specific way of thinking, so knowing that, it was easy to him to approach to you individually, to get what's in your mind 😉
btw yestarday your thread was next to Histogram passed and drawn into a Layer. Done!, where from it's easy to figure out how to check name of channel.
Copy link to clipboard
Copied
Kukurykus
You are right
it is I who am wrong to express myself and put the question correctly, you have told me several times that I have to ask the question in the right way
I thank you for the help you always give me.
r-bin can understand me because it has been following me for so long
and teaches me a lot
I'll never stop thanking him for everything he does.
Copy link to clipboard
Copied
try { app.activeDocument.channels["test"]; alert("ok"); } catch(e) { alert("ko"); }