Skip to content

SyntaxError: Unexpected token class (line 421, file "Code", project "GmailUtils") #14

@pony-bliberatore

Description

@pony-bliberatore

Trying your sample code. Added both libraries, and then added this code.

function saveExpenses() {
GmailUtils.processStarred('label:Accounting_PDF', 5, function(message) {

// create a pdf of the message
var pdf = GmailUtils.messageToPdf(message);

// prefix the pdf filename with a date string
pdf.setName(GmailUtils.formatDate(message, 'yyyyMMdd - ') + pdf.getName());

// save the converted file to the 'Expenses' folder within Google Drive
DriveUtils.getFolder('Accounting_PDF').createFile(pdf);

// signal that we are done with this email and it will be marked as read
return true;

});
}

Upon run, I receive this error:
SyntaxError: Unexpected token class (line 421, file "Code", project "GmailUtils")

Using version 4 of the GmailUtils and version 1 of the DriveUtils.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions