Ashung Thank you, that worked. Sorry, total newbie here. I've got another question.
I've also tried moving my text, but it doesn't seem to work. The following works for a shape:
backgroundStyle.sketchObject.frame().x = backgroundStyle.sketchObject.frame().x() - 20;
backgroundStyle.sketchObject.frame().y = backgroundStyle.sketchObject.frame().y() - 20;
When I try the same for my text layer, it get an error
layer.sketchObject.frame().y = 100;
TypeError: textProperties.frame is not a function. (In 'textProperties.frame()', 'textProperties.frame' is an instance of Rectangle)
I've tried it using 'layer.sketchObject.frame.y'. That doesn't give any errors, but it also doens't move the layer 100 px down.
I don't understand the difference. They are both layers? So shouldn't they move the same way.
I've checked the sketch developer docs, but can't find a way to move textlayers.