I'm trying to copy a ListItem with its associated GlyphType with the following code.
if( type == DocumentApp.ElementType.LIST_ITEM ) {
Logger.log("Glyph: " + element.getGlyphType());
newDocBody.appendListItem(element).setGlyphType(element.getGlyphType());
}
The log output shows a GlyphType of NUMBER but the next line sets the GlyphType of the new ListItem as BULLET.
From what I understand of the docs, getGlyphType() returns an GlyphType object, so couldn't this be used for setGlyphType()?
GlyphType is an ENUM object (basically, a load of IDs referenced by names) belonging to the DocumentApp class, and is accessed as any other static property.
So, if you wanted to set the bullets to be uppercase letters, you'd say something like:
myDocBody.appendListItem( "List item text" )
.setGlyphType( DocumentApp.GlyphType.LATIN_UPPER );
A list of the possible options is available at https://developers.google.com/apps-script/reference/document/glyph-type