You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a really small plugin that works fine, but when I use skpm to publish it, a bunch of extra code is added to the .sketchplugin file and causes it not to work. I'm using skpm so that it'll update in the Sketch Plugin library, but I don't need all the template stuff.
Sketch DevTools shows this when I run my plugin:
MOJavaScriptException: Error: Missing export named "inPage". Your command should contain something like `export function " + key +"() {}`.
I'm not sure why though, my plugin works fine when I run it directly from the plugin file before doing skpm build; this is all it is:
// Counts the number of artboards in the Sketch filefunctioninFile(context){varsketch=require('sketch');vardoc=context.document;constdocumentData=sketch.getSelectedDocument().sketchObject.documentData();varcountFile=(documentData.allArtboards().count());doc.showMessage("This document has "+countFile+" artboards");}// Counts the number of artboards in the current pagefunctioninPage(context){varsketch=require('sketch');vardoc=context.document;constcurrentPage=sketch.getSelectedDocument().selectedPage.sketchObject;varcountPage=(currentPage.artboards().count());doc.showMessage("This page has "+countPage+" artboards");}
I'm not a developer and have been stumbling my way through all this; any help is appreciated 😅
The text was updated successfully, but these errors were encountered:
I have a really small plugin that works fine, but when I use skpm to publish it, a bunch of extra code is added to the .sketchplugin file and causes it not to work. I'm using skpm so that it'll update in the Sketch Plugin library, but I don't need all the template stuff.
Sketch DevTools shows this when I run my plugin:
I'm not sure why though, my plugin works fine when I run it directly from the plugin file before doing
skpm build
; this is all it is:I'm not a developer and have been stumbling my way through all this; any help is appreciated 😅
The text was updated successfully, but these errors were encountered: