SEO Book Pro QA Audit Scripts Library Beta ( Dashboard Functions and Scripts )
SEO Book Pro QA Audit Google App Script Library Beta Deployment ID
SEO Book Pro QA Audit Google App Scripts Library URL
Custom Google App Script Function – function getContents(uri)
The getContents() function in Google Apps Script is a method that can be used on a variety of objects to retrieve the contents of the object. The specific functionality of getContents() depends on the type of object it is used on.
Here are some examples of what you can do with getContents() on different objects:
- Spreadsheet range: If you use getContents() on a range object in a Google Sheets spreadsheet, it will return the text content of the cells in the range as a 2D array
- Document body: If you use getContents() on the body object of a Google Docs document, it will return the text content of the document as a string
- Slides shape: If you use getContents() on a shape object in a Google Slides presentation, it will return the text content of the shape as a string
- Calendar event: If you use getContents() on an event object in a Google Calendar, it will return the description of the event as a string
In general, getContents() can be useful when you need to access the text content of an object in your Google Apps Script code. You can then use this text content to perform various operations, such as manipulating the text or using it as input for other functions.