19 Replies Latest reply on Jul 29, 2015 5:34 AM by Chuck Uebele

    CS4 script to CC2015

    StrongBeaver Level 3

      I'm hoping to get an authors old CS4 script, compatible with CC2015, I'm getting an error on line 2 when running the script ?

       

      try {
      var paintersWheel = new Object;
      
      
      paintersWheel.setForeground = function(color) {
        app.foregroundColor = paintersWheel.translateColor(color);
        }
      
      
      paintersWheel.getForeground = function() {
        xml = "<object>";
        xml += paintersWheel.convertToXML(app.foregroundColor.rgb.hexValue.toString(), "foreground");
        xml += "</object>";
        return xml;
        }
      
      
      paintersWheel.setBackground = function(color) {
        app.backgroundColor = paintersWheel.translateColor(color);
        }
      
      
      
      
      paintersWheel.setTool_brush = function() {
        xml = "<object>";
        xml += paintersWheel.convertToXML(app.foregroundColor.rgb.hexValue.toString(), "foreground");
        xml += "</object>";
        return xml;
        }
      
      
      
      
      paintersWheel.getBackground = function() {
        xml = "<object>";
        xml += paintersWheel.convertToXML(app.backgroundColor.rgb.hexValue.toString(), "background");
        xml += "</object>";
        return xml;
        }
      
      
      paintersWheel.translateColor = function(c) {
        var color = new SolidColor;
        color.rgb.red = (c >> 16) & 0xFF;
        color.rgb.green = (c >> 8) & 0xFF;
        color.rgb.blue = c & 0xFF;
        return color;
        }
      
      
      paintersWheel.convertToXML = function(property, identifier) {
         var type = typeof property;
         var xml = '<property id = "' + identifier + '" >';
         
         switch(type){
            case "number":
               xml += "<number>";
               xml += property.toString();
               xml += "</number>";
               break;
            case "boolean":
               xml += "<" + property.toString() + "/>";
               break;
            case "string":
               xml += "<string>";
               xml += property.toString();
               xml += "</string>";
               break;
            case "object":
               // Object case is currently not supported
               alert("Object case is currently not supported");
               //xml += "<object>";
               //for(var i in property)
               //   xml += convertToXML(property[i], 
               //xml += "</object>";
               break;
            case "undefined":
               xml += "<string>undefined</string>";
               break;
            default:
               alert("Type " + type + " is unknown.");
               return "";
         }
         xml += '</property>';
         return xml;
      }
      
      
      paintersWheel.getVersion = function () {
        xml = "<object>";
        xml += paintersWheel.convertToXML(app.version, "version");
        xml += "</object>"
        return xml;
      }
      
      
      
      
      }
      catch(e) {
        alert("PaintersWheel error: " + e + " : " + e.line);
      }
      
        • 1. Re: CS4 script to CC2015
          Philip Cord Level 4

          Try.

          var paintersWheel = new Object();

          1 person found this helpful
          • 2. Re: CS4 script to CC2015
            StrongBeaver Level 3

            try {

            var paintersWheel = new Object();

            The error is with the try command, or so I'm informed when running the script ?

            • 3. Re: CS4 script to CC2015
              Philip Cord Level 4

              Have you tried adding the brackets?

               

              The try command reports any errors.

              • 4. Re: CS4 script to CC2015
                StrongBeaver Level 3

                I added the brackets, didn't solve the problem; as the problem is with try ?

                • 5. Re: CS4 script to CC2015
                  Philip Cord Level 4

                  You will need someone with Photoshop 2015 to test it for you.

                  The problem is not with try, try is the error reporter. And you said it was Line 2 it reported as the error line.

                  • 6. Re: CS4 script to CC2015
                    Philip Cord Level 4

                    Just a thought, if you are running the script from ExtendScript Toolkit, you will get that error if you have not set the correct target.

                    2015-07-27_160803.jpg

                    • 7. Re: CS4 script to CC2015
                      JJMack Most Valuable Participant

                      Beaver do you have any idea of what that script is for all I see in it are functuone none of which are used in the script???

                       

                      try running this see if you get any ideas...

                       

                      try {

                      alert("hello Wortld");

                      var paintersWheel = new Object();

                       

                      paintersWheel.setForeground = function(color) {

                        app.foregroundColor = paintersWheel.translateColor(color);

                        }

                      alert("paintersWheel.setForeground = " + paintersWheel.setForeground);

                       

                      paintersWheel.getForeground = function() {

                        xml = "<object>";

                        xml += paintersWheel.convertToXML(app.foregroundColor.rgb.hexValue.toString(), "foreground");

                        xml += "</object>";

                        return xml;

                        }

                      alert("paintersWheel.getForegroundl = " + paintersWheel.getForeground);

                       

                      paintersWheel.setBackground = function(color) {

                      alert("color  " + color);

                        app.backgroundColor = paintersWheel.translateColor(color);

                        }

                      alert("paintersWheel.setBackground = " + paintersWheel.setBackground); 

                       

                       

                      paintersWheel.setTool_brush = function() {

                        xml = "<object>";

                        xml += paintersWheel.convertToXML(app.foregroundColor.rgb.hexValue.toString(), "foreground");

                        xml += "</object>";

                        return xml;

                        }

                      alert("paintersWheel.setTool_brush  = " + paintersWheel.setTool_brush );  

                       

                      paintersWheel.getBackground = function() {

                        xml = "<object>";

                        xml += paintersWheel.convertToXML(app.backgroundColor.rgb.hexValue.toString(), "background");

                        xml += "</object>";

                        return xml;

                        }

                      alert("paintersWheel.getBackground  = " + paintersWheel.getBackground );

                       

                      paintersWheel.translateColor = function(c) {

                      alert("c = " + c);

                        var color = new SolidColor;

                        color.rgb.red = (c >> 16) & 0xFF;

                        color.rgb.green = (c >> 8) & 0xFF;

                        color.rgb.blue = c & 0xFF;

                        return color;

                        }

                      alert("paintersWheel.translateColor = " + paintersWheel.translateColor);

                       

                      paintersWheel.convertToXML = function(property, identifier) {

                      alert("property, identifier = " + property + " ,n " + identifier)

                         var type = typeof property;

                         var xml = '<property id = "' + identifier + '" >';

                        

                         switch(type){

                            case "number":

                               xml += "<number>";

                               xml += property.toString();

                               xml += "</number>";

                               break;

                            case "boolean":

                               xml += "<" + property.toString() + "/>";

                               break;

                            case "string":

                               xml += "<string>";

                               xml += property.toString();

                               xml += "</string>";

                               break;

                            case "object":

                               // Object case is currently not supported

                               alert("Object case is currently not supported");

                               //xml += "<object>";

                               //for(var i in property)

                               //   xml += convertToXML(property[i],

                               //xml += "</object>";

                               break;

                            case "undefined":

                               xml += "<string>undefined</string>";

                               break;

                            default:

                               alert("Type " + type + " is unknown.");

                               return "";

                         }

                         xml += '</property>';

                      alert("xml= " + xml);

                         return xml;

                      }

                      alert("paintersWheel.convertToXML = " + paintersWheel.convertToXML);

                       

                      paintersWheel.getVersion = function () {

                        xml = "<object>";

                        xml += paintersWheel.convertToXML(app.version, "version");

                        xml += "</object>"

                      alert("xml= " + xml);

                        return xml;

                      }

                      alert("paintersWheel.getVersion  = "  + paintersWheel.getVersion );

                       

                       

                      alert("End of hello wotrld");

                      error=error

                      }

                      catch(e) {

                        alert("PaintersWheel error: " + e + " : " + e.line);

                      }

                      • 8. Re: CS4 script to CC2015
                        Chuck Uebele Adobe Community Professional & MVP

                        I ran it in 2015, and it didn't report any errors, I'm not sure what it's suppose to do.

                        • 9. Re: CS4 script to CC2015
                          regina63

                          The difference I see between what caused an error and what didn't is the parenthesis added to your line 2 which is line 3 in the suggested experiment, just before the semicolon. Just repeating it here because everyone thus far has mentioned as "brackets" instead of "parenthesis".

                          • 10. Re: CS4 script to CC2015
                            xbytor2 Level 4

                            CC2015 has a bad habit of not reporting some categories of syntax errors. The script will just be terminated silently.

                            Whenever I suspect that is happening, I fire up ESTK and do a syntax check. If that doesn't work, I run it under

                            CS6 and hopefully catch the error there.

                            1 person found this helpful
                            • 11. Re: CS4 script to CC2015
                              JJMack Most Valuable Participant

                              The script does not do anything.  If just a bunch of fuctions that are not use in the script.  It must be included in sone other script that use the defined functions in this included script.

                              1 person found this helpful
                              • 12. Re: CS4 script to CC2015
                                StrongBeaver Level 3

                                What script are you running from File > Scripts > ._PaintersWheel ? That is the only script that shows in my scripts list !

                                • 13. Re: CS4 script to CC2015
                                  JJMack Most Valuable Participant

                                  That script is not shipped with Photoshop.  You did not post that script or if you did what you posted is used by some other script for what you posted was some script functions that are not used in the script code that you posted.  They must be used by some other script you may have downloaded.

                                  • 14. Re: CS4 script to CC2015
                                    StrongBeaver Level 3

                                    It is not shipped with Ps, obviously, but that is the script, there is nothing more; besides some image files !

                                     

                                    It's supposedly works on CS4; if anyone can try on CS4, I would say CS5 as well but lets be literal and try it strictly on CS4, if possible !

                                    • 15. Re: CS4 script to CC2015
                                      JJMack Most Valuable Participant

                                      I see a download on the web for a panel for CS6 it has html flash and your script with install instructions. Did you read them?  It also may not work with current Photoshop for Adobe removed Flash support for panels. It does work I think in CS6 at least the panel opens... Also CC however there are no Panels folder in CC 2014 and CC 2015 to place them in....

                                      Capture.jpg

                                       

                                      Thank you for trying Painters Wheel

                                      An Adobe Photoshop CS4 and higher plug-in.

                                       

                                       

                                      To Use:

                                       

                                       

                                      1. Place this PaintersWheel folder in your Photoshop CS4 (or higher) application folder:

                                       

                                       

                                      On Mac this is located in:

                                      /Your Hard Drive/Applications/Adobe Photoshop CS4/Plug-ins/Panels

                                       

                                      On Windows this is:

                                      /Program Files/Adobe/PhotoshopCS4/Plug-ins/Panels

                                       

                                       

                                      2. Launch Photoshop

                                       

                                       

                                      3. Open the Window->Extensions menu

                                       

                                       

                                      You should see a "PaintersWheel" menu item.

                                      Select this. It should launch the color wheel in a new panel.

                                       

                                       

                                      You can minimize, combine, and stow the PaintersWheel panel like any other native panel in Photoshop.

                                       

                                       

                                      Now...Paint!

                                      1 person found this helpful
                                      • 16. Re: CS4 script to CC2015
                                        StrongBeaver Level 3

                                        I originally put the files in the Plug-ins Panel, started PsCC-2015 and it was not listed (Windows > Extensions) I assume the screen capture is CS6 ?

                                        • 17. Re: CS4 script to CC2015
                                          JJMack Most Valuable Participant

                                          You do not need to assume you just need to understand what you read. I'm not very good writing words. I tried to communicate  that the painters wheel plug-in required Flash Panel support that flash panel support was removed  by Adobe in Photoshop CC 2014. That there were no Plug-ins\Panels\ folder in CC 2014 and CC 2015 for you to copy the painter wheel folder into. That the painters wheel Panel worked in CS6 and in CC.

                                           

                                          All you need to do is read and understand that user here are trying to help you.  That most probably not all the information written for you is good information. It seem to me that for some unknown reason that you do not believe we can help you.

                                           

                                          Your not helping yourself.   From what I wrote you should know that the screen capture I posted was CS6 or CC for I wrote the painters wheel pannel worked in them... Flash panel support was remove by Adobe painters wheel panels need to be reprogrammed in html5 for CC 2014 and CC 2015....

                                          1 person found this helpful
                                          • 18. Re: CS4 script to CC2015
                                            Chuck Uebele Adobe Community Professional & MVP

                                            JJMack is correct: you are spinning your wheels trying to get this to work with 2014 or 2015. It just will not due to the usage of Flash.