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

CEP Javascript code to open Illustrator colorpicker from JSX

New Here ,
Jan 17, 2020 Jan 17, 2020

Copy link to clipboard

Copied

Hi,

I'm writing a Photoshop and Illustrator extension and I'm tryting to find the Javascript code that will open the standard colorpicker in Illustrator. Does anyone know the correct Javascript code I need to call in Illustrator to open the standard Illustrator colorpicker from a JSX file?

In Photoshop the call is -  app.showColorPicker() - which works fine, but I cannot find an equivalent call for Illustrator. I  do have a copy of the Adobe Illustrator CC 2017 Scripting reference (latest I could find on the internet) - which publishes the following command to open a colorpicker in Illustrator

$.colorPicker()

The problem is that this command (with the dollar sign) only opens an old legacy colorpicker and not the standard colorpicker that people expect to use- see image (the old legacy colorpicker that opens is the one on the right - but I need to open the colorpicker on the left)

i.is.cc/2D3xWNmK.png  

thanks in advance

 

TOPICS
Scripting , Third party plugins

Views

1.6K

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
New Here ,
Jan 17, 2020 Jan 17, 2020

Copy link to clipboard

Copied

Doh! - I Just dicovered this post from 2014 https://community.adobe.com/t5/illustrator/show-color-picker-dialog-jsx-csaw/td-p/5877341 which reminded me that the $.colorPicker() call is a basic Javascript colorpicker - and not from Illustrator at all - sadly it seems Adobe still hasn't published the code to access the Illustrator colorpicker - sigh - 😞

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
Advocate ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

Problem with this picker is, if you link it to a variable and call it from say an DIalog window. When closing the color picker panel, the dialog window is also closed. Not sure why this happens though.

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
Advocate ,
Dec 04, 2024 Dec 04, 2024

Copy link to clipboard

Copied

LATEST

I answer, so others can see it as well. But the same code works just fine. How ever, the parameter you can feed into the colorPicker function seems different. Where in Photoshop app.showColorPicker(true) will set the forgroundColor on return and also inputs that color so it doesnt start at black. In illustrator this works different, but the picker still shows

 

var storedDigitalColor = new RGBColor();
exportInfo.options.customDigitalColor = "128-128-128"
digitalColor = exportInfo.options.customDigitalColor.split('-');
                storedDigitalColor.red = digitalColor[0];
                storedDigitalColor.green = digitalColor[1];
                storedDigitalColor.blue = digitalColor[2];
completedDigital = app.showColorPicker(storedDigitalColor);

 

This example is from setting the color from a stored JSON file. Ive used this for a custom dialog.
Also what is different, in photoshop when you assign a variable to the showColorPicker. It returns a Boolean. Where in Illustrator it return a colorObject

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 ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

can we see your code? can you put together a simplified version of your UI for us to troubleshoot?

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