Yeah, you will need to drop down to cocoascript to do it. How familiar are you with cocoa programming? NSAttributedString https://developer.apple.com/documentation/foundation/nsattributedstring?language=objc and its mutable variant NSMutableAttributedString https://developer.apple.com/documentation/foundation/nsmutableattributedstring?language=objc are your friends.
You can use the
addAttribute_value_range method on NSMutableAttributedString
name can be one of a whole assortment of modifications https://developer.apple.com/documentation/foundation/nsattributedstringkey?language=objc but we're looking for
Put it all together, you have something like this:
let sketch = require('sketch')
let doc = sketch.getSelectedDocument()
let selection = doc.selectedLayers.layers
selection.sketchObject.addAttribute_value_forRange(NSBaselineOffsetAttributeName, 10, NSMakeRange(3,1))
(Select a text layer in sketch and run this in the Run Script Panel)
Note that I drop down to the native sketch object on the last line of code.
selection is a JS object whereas
selection.sketchObject is a native Sketch object called MSTextLayer (https://github.com/abynim/Sketch-Headers/blob/master/Headers/MSTextLayer.h#L49) which subclasses from NSAttributedString. Hope that helps! Let me know if you have further questions.