Skip to content

Instantly share code, notes, and snippets.

@koenbok
Created January 1, 2016 12:24
Show Gist options
  • Select an option

  • Save koenbok/0d8cbc395f8acfb8e4e0 to your computer and use it in GitHub Desktop.

Select an option

Save koenbok/0d8cbc395f8acfb8e4e0 to your computer and use it in GitHub Desktop.
Sketch Plugin Error
SyntaxError: Invalid flag supplied to RegExp constructor.
line: 5
sourceURL: /Users/koen/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin
column: 26
path = NSProcessInfo.processInfo().arguments()[0]
path = path.stringByDeletingLastPathComponent()
pluginPath = path + "/test.js"
pluginUrl = NSURL.fileURLWithPath(pluginPath)
sketch = [COScript app:"Sketch Beta"]
// sketch.delegate().runPluginScript(pluginPath)
// sketch.delegate().runPluginScript_name(pluginPath, "Framer")
sketch.delegate().evaluateScript("print(hello)")
print("Hello")
@koenbok
Copy link
Copy Markdown
Author

koenbok commented Jan 1, 2016

Whatever I do, I can't get a plugin to run from the terminal. I've tried pretty much every method on the app delegate but I always get some regex error back.

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