Skip to content

Instantly share code, notes, and snippets.

@tarngerine
Created July 15, 2015 18:02
Show Gist options
  • Save tarngerine/33ab78bf9bc414514034 to your computer and use it in GitHub Desktop.
Save tarngerine/33ab78bf9bc414514034 to your computer and use it in GitHub Desktop.
Force New Line Behavior Sketch Plugin
// Paste this into Plugins > Run Custom Plugin...
var allLayers = context.document.currentPage().children();
for(var i = 0; i < allLayers.count(); i++) {
if(allLayers[i].class() == 'MSTextLayer') {
// Set New Line Behavior
allLayers[i].setPrimitiveUsesNewLineSpacingBehaviour(true);
// Reset string value to trigger refresh
allLayers[i].setStringValue(allLayers[i].stringValue())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment