Kai and Yvan, Thanks to you guys I'm making progress. I've changed the script and it runs so that's not an issue but I'd like to make sure I understand what the problem was. In my original handler I had the line: "set imgHalfSize to resize image current document width (docWidth * 0.5)" which caused the undefined variable failure. From kai's explanation I gather that, since photoshop's "resize" command does not return a result, it's as if the command consisted of only "set imgHalfSize to". And conversely Yvans handler
on imgResize() set imgGT1000 to ((1200 > 1000)) set imgHalfSize to 2300 return {imgHalfSize, imgGT1000} end imgResize
works because imgHalfSize is given a normal value. The underlying problem is that I misunderstood what I was doing with that variable. So, if the goal is to reference a command that doesn't return a result (like resize image current document width (docWidth * 0.5)), should it be done as script object, handler, or something else? Or is that just not allowed?
|