Skip to content

Instantly share code, notes, and snippets.

@sonburn
Last active September 13, 2017 22:02
Show Gist options
  • Save sonburn/a11a8a42371269c27996c63a349105f7 to your computer and use it in GitHub Desktop.
Save sonburn/a11a8a42371269c27996c63a349105f7 to your computer and use it in GitHub Desktop.
var layerName = "Native/Bar/Nav",
predicate = NSPredicate.predicateWithFormat("name == %@",layerName),
layers = context.document.currentPage().children().filteredArrayUsingPredicate(predicate);
for (i = 0; i < layers.length; i++) {
layers[i].setIsLocked(0);
layers[i].frame().setHeight(42);
layers[i].select_byExpandingSelection(true,false);
context.document.actionsController().actionForID("MSAlignLayersBottomAction").doPerformAction(nil);
layers[i].setIsLocked(1);
layers[i].select_byExpandingSelection(false,false);
}
context.document.showMessage(layers.length + " layer(s) have been modified");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment