Copy link to clipboard
Copied
Looking at the Script-listener log, the first part of an action shows the following
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
Can anyone briefly explain what is happening in these 3 lines please
Line one is your function, and it has two values that are passed to it: enabled and withDialog. I don't know what is being checked or how it's being checked for the enabled part, but it should be a true/false value.
Line two checks to see if the value enabled has any value at all or is false. The ! is used as a negative, so !enabled is seeing if enabled is not true. the != undefined checks to see if enabled has a value at all. I'm not sure you really need that. just a if(!enabled) should work.
Lin
...Copy link to clipboard
Copied
Line one is your function, and it has two values that are passed to it: enabled and withDialog. I don't know what is being checked or how it's being checked for the enabled part, but it should be a true/false value.
Line two checks to see if the value enabled has any value at all or is false. The ! is used as a negative, so !enabled is seeing if enabled is not true. the != undefined checks to see if enabled has a value at all. I'm not sure you really need that. just a if(!enabled) should work.
Line 3 just tell the script to stop the function and return to the main script. if you had something after the return, it would return that value.
I hope that's what you mean my wanting to know what those 3 lines do.
Copy link to clipboard
Copied
Thanks Chuck, that has answered my question, it was the != undefined I was not sure about
Copy link to clipboard
Copied
Yea, like I said, I don't think that's really necessary, but if just the !enabled doesn't always work, you can add that back in.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now