Page 1 of 1

alert undefined in Photoshop cc 2015

Posted: Mon Dec 19, 2016 1:12 pm
by Chris_Kalmar
function hi() {
alert("My script is working Jeeej!");

var a = new CSInterface;
a.evalScript("hi()")

}

Photoshop returns undefined.
I don't know why is that?
undefined.jpg
undefined.jpg (25.25 KiB) Viewed 5832 times

Re: alert undefined in Photoshop cc 2015

Posted: Thu Dec 22, 2016 4:07 pm
by ApWizard
That's a bit curious, I did that more than once for testing purposes without getting that `undefined`. I call the evalScript direcly though:

Code: Select all


function hi(){
alert("hi there");
}

evalScript("hi()");
edit: oh, your curly brackets.

Re: alert undefined in Photoshop cc 2015

Posted: Fri Dec 23, 2016 9:41 am
by Chris_Kalmar
You are right! ApWizard Thank you!
It's working now!
- file :/// stays but undefined is gone :-)

I must say that I don't understand so far
evalScript and CSInterface I just adapted
some code where
this worked.

Do you use CSInterface?

Thanks one more
Chris

Re: alert undefined in Photoshop cc 2015

Posted: Fri Dec 23, 2016 2:28 pm
by ApWizard
I'm using it only for making the extension persistent.
I didn't really started to dig in there :D