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) { | |
//reference the Application | |
var app = [NSApplication sharedApplication]; | |
//reference the Sketch Document | |
var doc = context.document; | |
//reference all the pages in the document in an array | |
var pages = [doc pages]; |
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) { | |
//reference the Application | |
var app = [NSApplication sharedApplication]; | |
//reference the Sketch Document | |
var doc = context.document; | |
//reference all the pages in the document in an array | |
var pages = [doc pages]; |
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
@import 'common.js' | |
var onRun = function(context) { | |
//reference the Application | |
var app = [NSApplication sharedApplication]; | |
//reference the Sketch Document | |
var doc = context.document; | |
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
function alert(title, message){ | |
var app = [NSApplication sharedApplication]; | |
[app displayDialog:message withTitle:title]; | |
} |
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
{ | |
"name" : "My Plugin", | |
"identifier" : "my.plugin", | |
"version" : "1.0", | |
"description" : "My First Sketch Plugin", | |
"authorEmail" : "[email protected]", | |
"author" : "Your Name", | |
"commands" : [ | |
{ |
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]; | |
} |
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]; | |
} |
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(); |
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(); |
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]; |