doc = app.activeDocument;
var objects = doc.selection;
ObjectsHandler(objects);
function ObjectsHandler(collection){
for (var i = 0; i < collection.length; i++)
{
if (collection[i].typename == "PathItem"){
PathHandler(collection[i])
}
else if (collection[i].typename == "CompoundPathItem"){
CompoundPathHandler(collection[i]);
}
else if (collection[i].typename == "GroupItem"){
ObjectsHandler(collection[i].pageItems);
}
}
}
function CompoundPathHandler(compound){
for (var p = 0; p < compound.pathItems.length; p++){
PathHandler(compound.pathItems[p])
}
}
function PathHandler(path){
for (var p = 0; p < path.pathPoints.length; p++){
path.pathPoints[p].leftDirection = path.pathPoints[p].rightDirection = path.pathPoints[p].anchor;
}
}