node-sketch icon indicating copy to clipboard operation
node-sketch copied to clipboard

can not read sketch.colors

Open yishibakaien opened this issue 5 years ago • 4 comments

inspired of demo I do some thing like this

const ns = require('node-sketch');
const fs = require('fs')

ns.read('./test.sketch').then(sketch => {
  fs.writeFile('test.js', JSON.stringify(sketch.colors, null, 2)) // => got an empty array  []
})

how can I get all colors in some sketch file? sketch version 55.2

yishibakaien avatar Jul 04 '19 08:07 yishibakaien

Can you try sketch.colorAssets?

oscarotero avatar Jul 04 '19 16:07 oscarotero

Can you try sketch.colorAssets?

ns.read('./test.sketch').then(sketch => {
  fs.writeFile('test.js', JSON.stringify(sketch.colorAssets, null, 2)) // => got an empty array  too
})

the same result as sketch.colors

yishibakaien avatar Jul 10 '19 12:07 yishibakaien

Could I get a sketch file to reproduce this issue?

oscarotero avatar Jul 15 '19 11:07 oscarotero

I had the same issue, updating my Sketch to the last version fixed the problem.

thollander avatar Feb 09 '20 23:02 thollander