Copy link to clipboard
Copied
Hello friends! We need to get a script that verifies if the active document has a width of 210 mm:
If this is true = Run "task 1"
If this is false = Run "task 2"
Thank you
Agh, so all it was missing is >= sign then: if greater or equal to 210
if (activeDocument.width >= 210) {
// run task 1
} else {
// run task 2
}
However, if you want to run task 1 only if document is 210, then this:
if (activeDocument.width === 210) {
// run task 1
} else {
// run task 2
}
It all depends on what you are trying to do there.
Copy link to clipboard
Copied
if (activeDocument.width > 210) {
// run task 1
} else {
// run task 2
}
Like this?
Copy link to clipboard
Copied
Hi Tomas Sinkunas even with a 210mm wide document, it indicates as task 2.
if I edit the script for: if (activeDocument.width = 210) indicates as task 1. independent of size.
Copy link to clipboard
Copied
Agh, so all it was missing is >= sign then: if greater or equal to 210
if (activeDocument.width >= 210) {
// run task 1
} else {
// run task 2
}
However, if you want to run task 1 only if document is 210, then this:
if (activeDocument.width === 210) {
// run task 1
} else {
// run task 2
}
It all depends on what you are trying to do there.
Copy link to clipboard
Copied
It worked very well now! Thank you very much for the fast and efficient support Tomas Sinkunas
Copy link to clipboard
Copied
Sure thing buddy.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now