I'm trying to figure out how to identify inline code from google docs with script. I have a markdown conversion working for my purposes, but I have used markdown to add things like function names in the document, which does change the font (from my document default Source Code Pro to Roboto Mono, not sure how it decides this) and color to green. However, I can't seem to identify this element with google apps script.
I've been testing with one document and I used findText()
to find the string. But when I use getForegroundColor()
, it gives me null
. There's nothing in the attributes, but somehow obviously google docs identifies this and shows it correctly. I tried looking at the API, but I'm not as familiar with that, and I just don't know if this can actually be done... I thought it might've identified it as equation, but if I get the element, it is text.
I've searched and searched, but I don't think my skills are good enough to find the answer.
And just when I decided to post a question, I think I have found an answer. At least partially. But at least I have a code that gives me the formatted sections!
Help was found here: Advanced Docs Service: Read First Paragraph