Skip to content

Instantly share code, notes, and snippets.

@uhunkler
Created April 13, 2013 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uhunkler/5377902 to your computer and use it in GitHub Desktop.
Save uhunkler/5377902 to your computer and use it in GitHub Desktop.
header - JSTalk Sketch
var doc = doc || null,
app = null,
extern = false;
if( doc === null )
{
extern = true;
app = JSTalk.application("Sketch");
// app.activate();
doc = app.orderedDocuments()[0];
var selection = doc.selectedLayers();
}
else
{
app = NSApplication.sharedApplication();
}
@uhunkler
Copy link
Author

With this "header" Sketch JSTalk scripts can be used from "within" Sketch via the plugin menu and from the "ouside" with for example the JSTalk Editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment