Copy link to clipboard
Copied
i need to check, if all bleeds have the same value:
with (app.activeDocument.documentPreferences){
if (documentBleedBottomOffset==documentBleedTopOffset==documentBleedInsideOrLeftOffset==documentBleedOutsideOrRightOffset){
alert ("Make bleeds equal!"); exit()
}}
But if i try:
if (!documentBleedBottomOffset==documentBleedTopOffset==documentBleedInsideOrLeftOffset==documentBleedOutsideOrRightOffset){
nothing changes: line "alert" executes anyway. Why?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Why don't you test the boolean… documentBleedUniformSize
Copy link to clipboard
Copied
Muppet, you almost got me! But Bleed can be the same, even if the 'Make all settings the same' "checkbox" is not selected.
Dmitry, the proper syntax for "not x" is indeed "!x". But you need to use it on your entire expression:
if (!(documentBleedBottomOffset==documentBleedTopOffset==documentBleedIns ideOrLeftOffset==documentBleedOutsideOrRightOffset)) ...
-- note the extra set of parentheses.
Copy link to clipboard
Copied
Dmitry,
I did some experimenting on the console like so:
5==5==5==5
believe it or not, this came out false and that's because the first 5==5 was evaluated to true or 1 so the second comparison was actually 1==5 which was evaluated to false, or 0, and so on.
Interestingly enough, !5==5==5==5 in the console window was evaluated as false as well. It wasn't until I did this:
!(5==5==5==5)
that the expression was evaluated as true. That's because the internal expression was evaluated as false and the ! operator essentially flips the value to its opposite.
I think you want to refine your evaluation to something like this:
a = 11;
b = 10;
c = 10;
d = 10;
if(!(a == b && b == c && c == d)) //should evaluate to true
R,
John
Copy link to clipboard
Copied
Yes! Only this:
if(!(a == b && b == c && c == d))
does work properly.
Thanks, John.