Highlighting Attempt
✓ Published0🌍 Public
KKevinGutowski
Last edited Feb 11, 2020
Created on Feb 11, 2020
This example highlights the first four characters of selected text layers in a Sketch document with a yellow background. The script uses the Sketch JavaScript API through the `sketch` library to access the current document and its selected layers. It filters layers for those of type "Text" and then applies the highlighting by calling `addAttribute_value_forRange` with the `NSBackgroundColorAttributeName`, the color yellow, and a range covering positions zero through four. The operation directly manipulates the native Sketch layer objects via their `sketchObject` property.
AI-generated description