• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CS4 script to CC2015

Advisor ,
Jul 26, 2015 Jul 26, 2015

Copy link to clipboard

Copied

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,

         //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);

}

TOPICS
Actions and scripting

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Enthusiast ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

Try.

var paintersWheel = new Object();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

try {

var paintersWheel = new Object();

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

Have you tried adding the brackets?

The try command reports any errors.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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,

         //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);

}

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2015 Jul 28, 2015

Copy link to clipboard

Copied

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.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 28, 2015 Jul 28, 2015

Copy link to clipboard

Copied

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 !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2015 Jul 28, 2015

Copy link to clipboard

Copied

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!

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jul 28, 2015 Jul 28, 2015

Copy link to clipboard

Copied

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 ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 29, 2015 Jul 29, 2015

Copy link to clipboard

Copied

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....

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 29, 2015 Jul 29, 2015

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines