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

if the named channel exists it does one thing if it doesn't exist it does another

Advocate ,
Oct 10, 2020 Oct 10, 2020

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.

 

TOPICS
Actions and scripting

Views

430

Translate

Translate

Report

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

People's Champ , Oct 10, 2020 Oct 10, 2020
try { app.activeDocument.channels["test"]; alert("ok"); } catch(e) { alert("ko"); }

Votes

Translate

Translate
Adobe
LEGEND ,
Oct 10, 2020 Oct 10, 2020

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

Votes

Translate

Translate

Report

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
LEGEND ,
Oct 10, 2020 Oct 10, 2020

Copy link to clipboard

Copied

This is taken out of context. Unfortunately not first time.

Votes

Translate

Translate

Report

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
Advocate ,
Oct 11, 2020 Oct 11, 2020

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?

 

Votes

Translate

Translate

Report

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
LEGEND ,
Oct 11, 2020 Oct 11, 2020

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. 

Votes

Translate

Translate

Report

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
Advocate ,
Oct 11, 2020 Oct 11, 2020

Copy link to clipboard

Copied

LATEST

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.

 

Votes

Translate

Translate

Report

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
People's Champ ,
Oct 10, 2020 Oct 10, 2020

Copy link to clipboard

Copied

try { app.activeDocument.channels["test"]; alert("ok"); } catch(e) { alert("ko"); }

Votes

Translate

Translate

Report

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