Skip to main content
Participant
February 24, 2017
Question

Running photoshop through a script

  • February 24, 2017
  • 4 replies
  • 2155 views

Hello,

I'm running Photoshop through a script that runs many action script on different files.

My problem is not the script but something else.

When the script open Photoshop it get stuck on this error:

Photoshop cc exception: Cannot determine OGL version

If I manually press on the Photoshop that got opened, just like moving between windows, the scripts continue and everything is fine.

my problem is that I want it to run automatically but each time it get stuck on this error and I need to choose the Photoshop window manually in order for it to continue.

any idea How can I fix it so it won't throw this exception?

I'm running it on Adobe Photoshop CC 2017.

Thanks in advance,

Tomer.

This topic has been closed for replies.

4 replies

JJMack
Community Expert
Community Expert
February 27, 2017

If you have a script start Photoshop. If it starts Photoshop successfully How does the script get Photoshop run the script from the next script statement and when the Photoshop part is done would not the original external Jenkins JavaScript job not be in the scripts next statement.  Something in your description seems to be missing.   I think you would need a process similar to how the Bridge uses Photoshop via bridgetalk. I do not know for sure I just feel we are missing some needed information.

JJMack
Participant
February 27, 2017

Maybe it's my English.

Jenkin's Job is built in this way:

first, It find all the psds in the new folders

second, he write them into the script that will run later

third, it calls the script

The script is running in this way:

it is now got all the new files location in it in the form of an array.

it calls Photoshop to open the first file in the array

the script then run Photoshop's actions on the file, like exporting the layers as PNG files

then it open the next file in the array and so on until it gets to the end of the array and then close Photoshop.

the problem I am having is that it get stuck at the first time it open Photoshop.

I get this exception:

exception: Cannot determine OGL version

once I manually switch to the opened Photoshop window then scripts continues.

JJMack
Community Expert
Community Expert
February 27, 2017

tomerg1980  wrote

Maybe it's my English.

Jenkin's Job is built in this way:

first, It find all the psds in the new folders

second, he write them into the script that will run later

third, it calls the script

The script is running in this way:

it is now got all the new files location in it in the form of an array.

it calls Photoshop to open the first file in the array

the script then run Photoshop's actions on the file, like exporting the layers as PNG files

then it open the next file in the array and so on until it gets to the end of the array and then close Photoshop.

the problem I am having is that it get stuck at the first time it open Photoshop.

I get this exception:

exception: Cannot determine OGL version

once I manually switch to the opened Photoshop window then scripts continues.

Does not help much  In this description you do not state where or what script starts Photoshop. We now know there is more than one script being used.  It sound like one script writes as second script then may start Photoshop and end execution. That Photoshop will run the script written by the first external script that started Photoshop because of what the original script passed when it started Photoshop. The script will use the file list arrays is has, have Photoshop open files and also have Photoshop do its deeds on the documents opened.

If you are using Windows It you start Photoshop first when the script tries to start Photoshop windows will not start any version of Photoshop Windows will pass the running Photoshop what ever the script was passing the Photoshop it was starting. Mac OS or Mac Photoshop does not work the same way multiple copies of Photoshop can be started. 

JJMack
Chuck Uebele
Community Expert
Community Expert
February 26, 2017

Are you running your script before opening Photoshop? If so, you might want to make sure PS is open first. It sounds like an issue that can't be resolved by fixing a script.

Participant
February 27, 2017

Yeah, I don't think it is the problem with the script.

I think it worked before with a different version of Photoshop.

I'm running the script from Jenkins so unfortunately opening Photoshop first just doesn't go to the next line in Jenkins and run the script until I close the Photoshop window.

Chuck Uebele
Community Expert
Community Expert
February 26, 2017

Moving from Photoshop General forum to Photoshop Scripting forum.

c.pfaffenbichler
Community Expert
Community Expert
February 24, 2017

I'm running Photoshop through a script that runs many action script on different files.

What do you mean by that exactly?

What kind of Script and how is it triggered?

By »many action script« do you mean Actions?

You may want to ask on the Photoshop Scripting Forum.

Participant
February 25, 2017

Thank you for the reply.

It is a Javascript that I run from command line.

That script find all the psd files in some folders and then export the layers as png file.

basically running Photoshop's actions on those files one by one and then close Photoshop.

the script is running ok, but now Photoshop CC is giving me that exception when I run the script.

Once I manually  switch windows to the Photoshop window then the script continue.

If I'll only find some info as to what exactly is that exception and how can I prevent it from happening then the script won't get stuck.

c.pfaffenbichler
Community Expert
Community Expert
February 26, 2017

Once again: You may want to ask on the Photoshop Forum.

And post the complete Script/s.