Last active
August 28, 2016 19:55
-
-
Save marianomike/74922c653c3eea28c595f4292d4fa5d9 to your computer and use it in GitHub Desktop.
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 onRun = function(context) { | |
var doc = context.document; | |
var selection = context.selection; | |
if(selection.count() == 0){ | |
doc.showMessage("Please select something."); | |
}else{ | |
for(var i = 0; i < selection.count(); i++){ | |
var layer = selection[i]; | |
var layerClass = layer.class(); | |
if(layerClass == "MSShapeGroup"){ | |
//do something | |
} else if (layerClass == "MSBitmapLayer"){ | |
//do something | |
} else if (layerClass == "MSTextLayer"){ | |
//do something | |
} else if (layerClass == "MSSymbolInstance"){ | |
//do something | |
} else if (layerClass == "MSSymbolMaster"){ | |
//do something | |
} else if (layerClass == "MSArtboardGroup"){ | |
//do something | |
} else if (layerClass == "MSLayerGroup"){ | |
//do something | |
} | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment