Stroke property on Mac

var newColor = new RGBColor();
newColor.red = 0;
newColor.green = 0;
newColor.blue = 0;
for (var i = 0; i < activeDocument.selection.length; i++) {
var item = activeDocument.selection[i];
if (!item.stroked) {
item.stroked = true;
item.strokeWidth = 1; // units: pt
item.strokeColor = newColor;
}
}
A stroke may be added at random
In CC 2021 the stroke is added
The script has added and filled the stroke not on all objects
var USER_OS = $.os.toLowerCase().indexOf('mac') >= 0 ? 'MAC': 'WINDOWS';
var AI_VER = parseInt(app.version);
if (USER_OS == 'WINDOWS' || (USER_OS == 'MAC' && AI_VER >=24)) {
var isAddStroke = dialog.add('checkbox', undefined, 'If there is no stroke, add it');
isAddStroke.value = true;
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store