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)
thanks in advance
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 - 😞
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
can we see your code? can you put together a simplified version of your UI for us to troubleshoot?