Error 1302 : No such element

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

Dohny

Error 1302 : No such element

Post by Dohny »

Hello,

I'm new in this forum (and new to PS script writing to be honnest !) and I'm having my first little problem.

I'm using wade's script (bb/viewtopic.php?t=411&highlight=pixel+color+colour) in order to pick the color of a pixel. When I launch the script, PS returns the error :
"Error 1302: No such element" (Translation from the french : Elément inexistant)
concerning the code :
pChannel = curDoc.channels.getByName("Red").histogram;

I've checked the code several times, and everything seems ok to me... I actually don't even understand the meaning of this error.

By the way, I wondered if anybody could give me tips to debug PS scripts...

Thanks !
Mike Hale

Error 1302 : No such element

Post by Mike Hale »

I would think of possible two reasons for this error. The error says that it can not find a channel with the name of 'Red'.

1 Is you doc in RGB mode? Only RGB files will have a 'RED' channel. If your doc is not RGB you will have to change the script or you doc

2 If it is RGB, is the channel called 'Red' in the channel palette? The only other thing I can think is that the red channel uses the french word for red in your version of Photoshop
Dohny

Error 1302 : No such element

Post by Dohny »

Well, thanks a lot Mike for your answer !

I had checked that the picture was in RGB mode, but I hadn't checked about the name of the channels ! My channel is actually Rouge as you said !!

Yet, now I wonder : do you think that the name of the channels depend on the language of the soft with which the image has been saved or does it only depend on the soft with which you open the image ?


Again, thanks a lot for your fast and accurate answer !
Mike Hale

Error 1302 : No such element

Post by Mike Hale »

I think that it is the version you are using. There are other issuses that can break a script because of the language version of Photoshop is different than the one the script was tested in . The OS or app path and error messages are other problem areas.

Would you be willing to work with me, perhaps by email, to compile a list of differences between the french version and the english version that we can post here to help other script writers localize their scripts?

Mike
Dohny

Error 1302 : No such element

Post by Dohny »

Ok... as soon as I have my script done and working on my machine, I try it on the english version of the soft.

About working on the differences between area versions, I'd be glad but I'm really beginner in scripting... so it would mean that you would have to pilot me a little bit !

If you're still interested, just send me a pm and we'll work this out !

Thanks again !