Closed juliussohn closed 6 years ago
I just tried this and it works:
log(context.document.selectedLayers().layers()[0].frame().height())
// 200
context.document.selectedLayers().layers()[0].frame().height = 300
log(context.document.selectedLayers().layers()[0].frame().height())
// 300
BTW, for plugin-related questions, http://sketchplugins.com is a much better place to ask : )
@bomberstudios Thanks, but this is the old syntax, I would like to make the new work.
Thanks for the tip :)
Then check https://github.com/BohemianCoding/SketchAPI : )
Sounds like a bug. Can you open an issue https://github.com/BohemianCoding/SketchAPI ?
@mathieudutour I will!
Meanwhile to make it work you can use the sketchObject
property of the layer:
document.selectedLayers.layers[0].sketchObject.frame.height = 100
document.selectedLayers.layers[0].frame.height=100
does not do anything. The layer exists and I can get the height etc. But I can't set it. Am I missing something?