11 Replies Latest reply on Feb 27, 2017 5:39 AM by JJMack

    Running photoshop through a script

    tomerg1980

      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.

        • 1. Re: Running photoshop through a script
          c.pfaffenbichler Level 9

          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.

          • 2. Re: Running photoshop through a script
            tomerg1980 Level 1

            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.

            • 3. Re: Running photoshop through a script
              c.pfaffenbichler Level 9

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

              And post the complete Script/s.

              • 4. Re: Running photoshop through a script
                Chuck Uebele Adobe Community Professional & MVP

                Moving from Photoshop General forum to Photoshop Scripting forum.

                2 people found this helpful
                • 5. Re: Running photoshop through a script
                  Chuck Uebele Adobe Community Professional & MVP

                  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.

                  • 6. Re: Running photoshop through a script
                    tomerg1980 Level 1

                    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.

                    • 7. Re: Running photoshop through a script
                      JJMack Most Valuable Participant

                      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.

                      • 8. Re: Running photoshop through a script
                        tomerg1980 Level 1

                        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.

                        • 9. Re: Running photoshop through a script
                          JJMack Most Valuable Participant

                           

                          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. 

                          • 10. Re: Running photoshop through a script
                            tomerg1980 Level 1

                            I start the script in this way:

                            in shell command from Jenkins

                            "$PHOTOSHOP" "$WORKSPACE\TWOD_TextueExport_temp2.jsx"

                             

                            inside TWOD_TextueExport_temp2.jsx there is the array with the files names.

                            to start Photoshop again I just changed the shell command to be:

                            "$PHOTOSHOP"

                            "$PHOTOSHOP" "$WORKSPACE\TWOD_TextueExport_temp2.jsx"

                            • 11. Re: Running photoshop through a script
                              JJMack Most Valuable Participant

                              If the problem you are having is Photoshop has a problem starting when started from your Jenkins environment.  I would not think starting it twice from Jenkins would help any.   If you are running Windows OS starting any version of Photoshop before you start  up your Jenkins Script may Help for when you try to start Photoshop from your Jenkins environment Windows will not start Photoshop instead it will Pass to the the already up and running Photoshop what your Jenkins Script is Passing while starting Photoshop.

                               

                              In A Windows environment Multiple instances of Photoshop can not be run the way things are coded.  Only one instance of Photoshop can be running. If anything tries to start Photoshop like a double on an image file in file explorer what will happen is the file will be passes to the running instance of Photoshop .  So when your jenkins script tries  starts and passes a file to Photoshop what will likely happen instead is the File will be passed to the running instance of Photoshop

                               

                               

                              I have my Image file extension associated with CC 2014 its the best version of Photoshop.   If Photoshop is not running and I double click on a jpg image file Windows will start CC 2014 and be passes the jpg image file to open.   If on the other hand  a Photoshop  version like CC 2017 had been started and was open. When I double click on a jpg file in file explorer the Running version of Photoshop will be pass the jpg file to open.