pixelcog / gmail-to-pdf

A Google Apps Script library for converting Gmail messages to PDFs for easy archival.
http://bit.ly/1CsBl8U
122 stars 38 forks source link

Functions not returning anything. #3

Open ghost opened 8 years ago

ghost commented 8 years ago

Trying to work with these handy scripts, but it seems like these callback functions like

GmailUtils.processStarred('label:Expenses', 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('Expenses').createFile(pdf);
    // signal that we are done with this email and it will be marked as read
    return true;
  });

or

// limit this to 10 threads (may be more than 10 messages)
  GmailUtils.processStarred('label:領収証', 1, function(message) {
    messages.push(message);
    return true;
  });

are actually not returning anything. Has Google changed their api at all? Am I the only one who has these problems?

Will try to debug by myself, but just wanted to point out what's happening! Thank you!

massou commented 6 years ago

Hi, just a little remind that's this scripts are ok with "starred" emails.