![]() ![]() This function will get the parent folder in Google drive Var file = DriveApp.createFile(attachmentBlob) var isDefinedType = checkIfDefinedType_(attachment) Var attachments = mesgs.getAttachments() query += ' after:'+getDateNDaysBack_(1) Query = 'in:inbox has:nouserlabels ' + query Query += (query = '' ?('filename:'+fileTypesToExtract) : (' OR filename:'+fileTypesToExtract)) filename:jpg OR filename:tif OR filename:gif OR fileName:png OR filename:bmp OR filename:svg' //'after:'+getDateNDaysBack_(1)+ Name of the label which will be applied after processing the mail message ![]() Name of the folder in google drive i which files will be put Array of file extension which you would like to extract to Drive (credit goes to for the code) // GLOBALS Also, it still seems to be downloading all filetypes from emails that have more than one attachment when I just need. ![]() I found the code below that does that part well, but I also need it to overwrite files of the same name with the new file or delete the old file and upload the new in its place. I am trying to user Google Apps Script to automate downloading attachments from a Gmail inbox to a specific folder on the account's Google Drive.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |