Using Google Apps Script, is there a function to check if a Gmail label has nested sub-labels? If a label has one or more sub-labels I want to exclude them from a code sequence.
相关问题
- How can I force all files in a folder to be owned
- Google Apps Script: testing doPost() with cURL
- Google Apps Script to turn in, grade, and return a
- Script fails on SpreadsheetApp.openById - Requires
- Gmail IMAP with PHP?
相关文章
- How to allow access for importrange function via a
- Google app script trigger not working
- Debug HTML Email in Gmail App
- Sending email using php, gmail, and swiftmailer ca
- Set Date/Time to 00:00:00
- indexOf returning -1 despite object being in the a
- How can my Google Apps Script be run by others the
- How to read the Content Type header and convert in
There is no direct method to get labels from a "parent" label but this is quite simple to get using the simple
getUserLabels()
method documented here and illustrated by the following small code :This will show a list of all your labels and from the second loop you'll get a list of all Labels that have at least one sub-Label.
Note that this script has to be improved because it will consider INBOX (for example but not only) as a label which is not really what you want but that part will be easy to manage with a few conditions.