Last active
December 16, 2015 16:44
-
-
Save lm913/7f571461565540797eea to your computer and use it in GitHub Desktop.
Consistent counting of path points for determining complexity
This file contains 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; | |
try{ | |
var numPaths = docRef.pathItems.length; | |
var topPath = docRef.pathItems[0]; | |
var topPathSub = docRef.pathItems[0].subPathItems[0]; | |
if (numPaths > 0){ | |
topPath.makeSelection(); | |
docRef.selection.makeWorkPath(5); | |
docRef.pathItems["Work Path"].name = "CountPathPoints"; | |
alert(docRef.pathItems["CountPathPoints"].subPathItems[0].pathPoints.length); | |
} | |
docRef.pathItems["CountPathPoints"].remove(); | |
} | |
catch (numPaths) { | |
alert("No paths exist!"); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment