我已经将此function制成了JS文件...
function getColors(isPick, isForecolor)
{
var chosenFunction = 'getColor(' + isPick + ', ' + isForecolor + ')';
csInterface.evalScript(chosenFunction, function(result)
{
if(result !== 'undefined')
{
if (isForecolor == true){
foregroundHexColor = result;
// etc...
}
else
{
backgroundHexColor = result;
//etc..
};
};
});
};
哪个[[获取一种十六进制颜色值来自此功能来自JSX文件。
function getColor(isPick, isForecolor)
{
var color_PickerCase;
var decimal_Color;
var hexadecimal_Color;
if (isForecolor == true)
{
color_PickerCase = app.foregroundColor.rgb.hexValue;
}
else
{
color_PickerCase = app.backgroundColor.rgb.hexValue;
};
if (isPick == true)
{
if (app.showColorPicker(isForecolor)){
decimal_Color = color_PickerCase;
hexadecimal_Color = decimal_Color.toString(16);
}
else
{
return;
};
}
else
{
decimal_Color = color_PickerCase;
hexadecimal_Color = decimal_Color.toString(16);
};
return hexadecimal_Color;
};
以某种方式起作用,但是由于某种原因,我必须做同样的事情才能获得价值!!!知道为什么会这样吗?谢谢您的时间!两次
UPDATE
:更正,仅在第一次单击时有效。然后需要单击两次以获取值!!!>我已将此函数制作为JS文件... function getColors(isPick,isForecolor){var selectedFunction ='getColor('+ isPick +','+ isForecolor +')'; csInterface.evalScript(...