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: xbytor, DavideBarranca, Paul MR

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

alert undefined in Photoshop cc 2015

Postby Chris_Kalmar » Mon Dec 19, 2016 1:12 pm

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 534 times


Hit run and get some fun!

ApWizard
Posts: 9
Joined: Fri Dec 16, 2016 7:39 am

Re: alert undefined in Photoshop cc 2015

Postby ApWizard » Thu Dec 22, 2016 4:07 pm

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

Postby Chris_Kalmar » Fri Dec 23, 2016 9:41 am

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
Hit run and get some fun!

ApWizard
Posts: 9
Joined: Fri Dec 16, 2016 7:39 am

Re: alert undefined in Photoshop cc 2015

Postby ApWizard » Fri Dec 23, 2016 2:28 pm

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


Return to “Help Me”

Who is online

Users browsing this forum: No registered users and 2 guests