alert undefined in Photoshop cc 2015

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

User avatar
Chris_Kalmar
Posts: 12
Joined: Wed Dec 14, 2016 9:51 pm

alert undefined in Photoshop cc 2015

Post 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 5805 times
ApWizard
Posts: 9
Joined: Fri Dec 16, 2016 7:39 am

Re: alert undefined in Photoshop cc 2015

Post 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.
User avatar
Chris_Kalmar
Posts: 12
Joined: Wed Dec 14, 2016 9:51 pm

Re: alert undefined in Photoshop cc 2015

Post 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
ApWizard
Posts: 9
Joined: Fri Dec 16, 2016 7:39 am

Re: alert undefined in Photoshop cc 2015

Post by ApWizard »

I'm using it only for making the extension persistent.
I didn't really started to dig in there :D