Is it possible to programmatically obtain (set) several text attributes in one cell of a spreadsheet?

Since the introduction of the new version of spreadsheets, you can change the text attributes inside one cell (or merged cells) manually, as in this example:

(left = source text, right = formatted text, easier to read)

enter image description here

I see no way to achieve this with a script ... I see neither a problem nor a function request in the problem tracker.

Is it possible?

Each method that I try to get the attributes of the text returns only one value, so I'm afraid that I just can’t do this ... but who knows?

+6
source share
1 answer

In 2016, when this answer was originally published, it was impossible for Google Sheets to programmatically apply formatting to parts of the contents of cells.

Note the following feature request regarding issues with Google Apps scripts and the official feature request site is now fixed.

Issue 6000: Programmatically Processing Parts of Cell Content

According to the January 22, 2019 release notes, Google Apps Script has been updated to include new classes and methods for handling formatting cell contents, such as RichTextValue .

+1
source

All Articles