Skip to content

Instantly share code, notes, and snippets.

@lm913
Last active December 16, 2015 13:56
Show Gist options
  • Save lm913/0be556d963f9d91b4c9d to your computer and use it in GitHub Desktop.
Save lm913/0be556d963f9d91b4c9d to your computer and use it in GitHub Desktop.
Script to delete empty paths
var docRef = app.activeDocument;
var numPaths = docRef.pathItems.length;
var pathsLeft = numPaths
if (numPaths > 0){
for (var i = 0; i < pathsLeft; i++){
var pathSelected = docRef.pathItems[i];
if(pathSelected.subPathItems.length==0){
docRef.pathItems[i].remove();
pathsLeft = pathsLeft - 1;
i=i-1;
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment