Skip to content

Instantly share code, notes, and snippets.

@marianomike
Last active September 12, 2016 14:13
Show Gist options
  • Save marianomike/34becb08e744f74ad059dacd98fe8c99 to your computer and use it in GitHub Desktop.
Save marianomike/34becb08e744f74ad059dacd98fe8c99 to your computer and use it in GitHub Desktop.
var onRun = function(context) {
//reference the Sketch Document
var doc = context.document;
//reference all the pages in the document in an array
var pages = [doc pages];
//loop through the pages of the document
for (var i = 0; i < pages.count(); i++){
//reference each page
var page = pages[i];
//get the name of the page
var pageName = [page name];
//show the page name in the console
log(pageName);
}
//show a message at the bottom of Sketch
doc.showMessage("MyPlugin Finished!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment