gespinha
gespinha

Reputation: 8497

Photoshop Script - How to check if any document is open?

How do I check if any document is open in Photoshop?

Through Photoshop Script

I've tried activeDocument.length, but it returns that activeDocument is not defined.

I wanted something like this:

if(documents.open === 0){
    alert('NO DOCUMENT');
} else {
    alert('DOCUMENT OPEN');
}

Upvotes: 0

Views: 1993

Answers (1)

Ghoul Fool
Ghoul Fool

Reputation: 6967

Close, but no banana. You want

documents.length

See it here:

  if (documents.length == 0)
  {
      alert("No files open to work with, dude!")
  }

Upvotes: 3

Related Questions