How do I access the values inside the Color panel or know whether it's currently set to stroke or fill?
Hello, very new to scripting. I know that I can assign a color to selected objects:
app.documents.add(DocumentColorSpace.RGB)
// get the active document
var doc = app.activeDocument;
// verify there is a document and at least one shape,
// enumerate through each pathItem and assign a given color to fill
if ( app.documents.length > 0 && app.activeDocument.pathItems.length > 0) {
var newColor = new RGBColor;
newColor.red = 255;
newColor.green = 0;
newColor.blue = 0;
for (var a=0; a<app.selection.length; a++) {
try {
var currentSelection = app.selection;
// But how would I know whether Stroke or Fill is active here?
currentSelection.fillColor = newColor;
}
catch (e){alert(e)
}
}
}

With AutoHotKey, I can use ControlGetText on the input element of the Color Panel ("Edit 15") to directly interact and easily apply colors by submitting a new value within it, which accurately sends it as a stroke or fill depending on which is currently toggled. Is there any way to replicate this and have access to the current/active value within this panel?
