-1

Im having issues trying to do the following. It keeps stopping at the return attribute. Thanks! I want this to check for various filenames and then change the output for those values.. thx.

  if (activeDocument.search("160x600")>0)
    {
        if (activeDocument.search("300x600")>0)
        {
           path: activeDocument.path,
           maxSize: 59 //size in kbs
           return
        };
        saveJPG(
        {
            path: activeDocument.path,
           maxSize: 39 //size in kbs
        });  
Likenota
  • 87
  • 8

1 Answers1

0

(taking the numbers from your other post, you probably want somethinglike this:

if (activeDocument.name.search("160x600")>0)
    {
    maxSize: 39
    }

else if (activeDocument.name.search("300x600")>0)
    {
    maxSize: 59
    }

else if (activeDocument.name.search("1500x513")>0)
    {
    maxSize: 150
    }

else
    {
    alert ('document not saved')

    }

Afterward, you can call the saveJPG function, passing whatever value of maxSize has been selected

cybernetic.nomad
  • 6,100
  • 3
  • 18
  • 31