tylergaw / day-player

A Sketch Plugin for creating placeholder images from online services.
MIT License
391 stars 22 forks source link

Not working with last beta (3.0.4) #6

Closed jiserra closed 10 years ago

jiserra commented 10 years ago

The plugin doesn't work with the last beta of Sketch. The console app says:

29/05/14 16:28:09,467 Fill Murray (Sketch Plugin)[58693]: ReferenceError: Can't find variable: scriptPath.
Plugin “Fill Murray”, line 3.
» var pluginPath = scriptPath.substring(0, scriptPath.lastIndexOf('/')); «
29/05/14 16:28:09,467 Sketch Beta[58693]: Exception: {
    line = 3;
    stack = "global code";
}
tylergaw commented 10 years ago

Thanks @jiserra

We were talking about this on the mailing list. Seems leaving the global scriptPath var out was an omission by the Sketch folks. They're going to add it back in, but plan to remove it completely in a future release. Instead of accessing scriptPath globally plugins would access it at sketch.scriptPath

I went ahead and updated my reference to it using sketch.scriptPath in https://github.com/tylergaw/day-player/pull/7

I also updated occurrences of the global-for-now-maybe-not-later doc and selection vars.

Sam at Sketch gave us the details here: http://mail.sketchplugins.com/pipermail/dev_sketchplugins.com/2014-May/000339.html

Thanks for reporting