Reputation: 61
Google document allows to add list items with a checkboxes, like on the screenshot below:
I need to write a appscript to check if list item has a checbox, but i haven't found appropriate field/method in documentation and this kind of list item return null
instead of GlyphType:
Does anyone know if it is actually possible somehow?
Upvotes: 1
Views: 559
Reputation: 174
Log time of this question.
From Google, nothing relevant about this has changed, but I am working on a script when I need to check the glypth type too. My strategy(a workaround) is simple and it is working: if elem.getGlyphType() is diferent to all DocumentApp.ElementType Enums, it returns null; so
if(elem.getGlyphType()==null){
//it is a checkbox
}
Take care: When Google(a dream day) add a new enum type to checkboxes it didnt work
Maybe it helps someone.
Upvotes: 0
Reputation: 15375
But there is already a report on Google's Issue Tracker which requests the behaviour you seek:
Google does seem to know about this feature request but if it's causing problems I suggest leaving a comment to bump its priority.
You can also hit the ☆ next to the issue number in the top left on the aforementioned pages which lets Google know more people would like to see this implemented.
Upvotes: 2