HowTo update all the bullet list items in a Google Doc to use the HOLLOW_BULLET glyph type

How To update all the bullet list items in a Google Doc to use the HOLLOW_BULLET glyph type. This script will iterate over every list item in the document and change its glyph type to HOLLOW_BULLET if it is a bullet list item. This operation directly affects the appearance of list items in the document.

Here’s an updated version of the script that accomplishes this task:

function convertBulletsToHollowBullets() {
  var doc = DocumentApp.getActiveDocument();
  var body = doc.getBody();
  var lists = body.getListItems();
  
  for (var i = 0; i < lists.length; i++) {
    var listItem = lists[i];
    var glyphType = listItem.getGlyphType();
    
    // Check if the current list item is any type of bullet
    if (glyphType === DocumentApp.GlyphType.BULLET || glyphType === DocumentApp.GlyphType.HOLLOW_BULLET || glyphType === DocumentApp.GlyphType.SQUARE_BULLET) {
      // Get the current list item's attributes
      var attributes = listItem.getAttributes();
      
      // Change the glyph type to HOLLOW_BULLET
      attributes[DocumentApp.Attribute.GLYPH_TYPE] = DocumentApp.GlyphType.HOLLOW_BULLET;
      
      // Set the updated attributes back to the list item
      listItem.setAttributes(attributes);
    }
  }
}

This script checks each list item to see if it is a bullet list item (of any bullet type) and then updates its GlyphType to HOLLOW_BULLET. Note that this script will affect all bullet list items in the document, regardless of their original bullet style.

To use this script:

  1. Open your Google Doc.
  2. Go to Extensions > Apps Script.
  3. Delete any code in the script editor and paste the above script.
  4. Save the script with a name you’ll remember.
  5. Run convertBulletsToHollowBullets function from the Apps Script editor by clicking the play/run button.
  6. You might need to authorize the script to run under your account. Follow the prompts to grant the necessary permissions.

After running the script, all bullet list items in your document should be updated to use the HOLLOW_BULLET glyph.