Last active
December 16, 2015 13:56
-
-
Save lm913/0be556d963f9d91b4c9d to your computer and use it in GitHub Desktop.
Script to delete empty paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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