andrewfiorillo / sketch-palettes

A Sketch plugin for exporting and importing fill presets. It supports colors, gradients, and pattern fills.
MIT License
2.27k stars 134 forks source link

cannot save or load in Sketch 53 #79

Closed chadlavi-casebook closed 5 years ago

chadlavi-casebook commented 5 years ago

I was previously able to save a palette from this same file, and was previously able to load that palette in other files. Now, nothing happens in the UI when I try to save a palette or try to load a previously created palette.

Here's the output of my crash.log from the Plugins folder:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
    <string>instant HandlerGotFocus {
    name = Normal;
}</string>
    <string>begin SelectionChanged {
    document = "&lt;MSDocument: 0x7fe746a80350&gt;";
    newSelection =     (
    );
    oldSelection =     (
    );
}</string>
    <string>finish SelectionChanged {
    document = "&lt;MSDocument: 0x7fe746a80350&gt;";
    newSelection =     (
    );
    oldSelection =     (
    );
}</string>
    <string>begin RunPlugin {
    action = "&lt;MSRunPluginAction: 0x6000005c8810&gt;";
}</string>
    <string>begin RunPluginCommand {
    command = "com.andrewfiorillo.sketch.sketch-palettes/savePalette";
    document = "&lt;MSDocument: 0x7fe746a80350&gt;";
    selection =     (
    );
}</string>
    <string>begin Log {
    action = "&lt;MSLogAction: 0x600001712e00&gt;";
    command = "&lt;MSPluginCommand: 0x600006726700&gt;";
    level = error;
    payload =     (
        "TypeError: assets.colors is not a function. (In 'assets.colors()', 'assets.colors' is undefined)"
    );
    stringValue = "TypeError: assets.colors is not a function. (In 'assets.colors()', 'assets.colors' is undefined)\nline: 91\nsourceURL: /Users/chad/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Sketch Palettes.sketchplugin/Contents/Sketch/sketchPalettes.js\ncolumn: 34\nstack: setCheckboxStates@/Users/chad/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Sketch Palettes.sketchplugin/Contents/Sketch/sketchPalettes.js:91:34\nsavePalette@/Users/chad/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Sketch Palettes.sketchplugin/Contents/Sketch/sketchPalettes.js:105:19\n";
}</string>
    <string>finish Log {
    action = "&lt;MSLogAction: 0x600001712e00&gt;";
    command = "&lt;MSPluginCommand: 0x600006726700&gt;";
    level = error;
    payload =     (
        "TypeError: assets.colors is not a function. (In 'assets.colors()', 'assets.colors' is undefined)"
    );
    stringValue = "TypeError: assets.colors is not a function. (In 'assets.colors()', 'assets.colors' is undefined)\nline: 91\nsourceURL: /Users/chad/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Sketch Palettes.sketchplugin/Contents/Sketch/sketchPalettes.js\ncolumn: 34\nstack: setCheckboxStates@/Users/chad/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Sketch Palettes.sketchplugin/Contents/Sketch/sketchPalettes.js:91:34\nsavePalette@/Users/chad/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Sketch Palettes.sketchplugin/Contents/Sketch/sketchPalettes.js:105:19\n";
}</string>
    <string>finish RunPluginCommand {
    command = "com.andrewfiorillo.sketch.sketch-palettes/savePalette";
    document = "&lt;MSDocument: 0x7fe746a80350&gt;";
    selection =     (
    );
}</string>
    <string>finish RunPlugin {
    action = "&lt;MSRunPluginAction: 0x6000005c8810&gt;";
}</string>
    <string>begin OpenPluginPreferences {
    action = "&lt;MSOpenPluginPreferencesAction: 0x6000005c84b0&gt;";
}</string>
    <string>finish OpenPluginPreferences {
    action = "&lt;MSOpenPluginPreferencesAction: 0x6000005c84b0&gt;";
}</string>
</array>
</plist>

seems the way color assets are handled in Sketch 53 is different?

Details:

andrewfiorillo commented 5 years ago

@chadlavi-casebook hello! They did change how colors are handled. The plugin was updated yesterday to make it work properly with Sketch 53 (and also added support for naming presets!). Have you updated to that version of the plugin yet? If not, hopefully that will fix your issue.

chadlavi-casebook commented 5 years ago

Huh, thanks for the heads up @andrewfiorillo. For some reason Sketch doesn't know about the 2.2 release yet. I'll download it from this repo and manually replace 2.14.

andrewfiorillo commented 5 years ago

Hmm. that's unfortunate it didn't know about the new version. I'll look into that. Thanks for letting me know!

chadlavi-casebook commented 5 years ago

can confirm that 2.2 is working. Thanks!