0
votes

I can only get gscript to attach an excel formatted file from google drive. I need to be able to access the document without google drive. So I want the g script to attach the file, as an editable excel file, from the desktop, or another folder.

I've tried different ways of attaching the file, I can only get it to be as a PDF from the desktop, or excel from google drive. I need to get it in the email as an editable excel file from the desktop.

var file = DriveApp.getFileById('xxxxx');
GmailApp.sendEmail(emailAddress, subject, body, {cc: copy, attachments: 
[file]});

It's sending the file via drive, i'd like to circumvent that by just getting the file from a folder or my desktop.

1
It may be but I don't fully understand the answer in the link you provided.Lukec

1 Answers

1
votes

With a Apps Script it is not feasible if you use just a script that run in the script editor.

The only way you can have to do something similar, would be to build a web app or display a screen in a sheets or docs to use the drive picker.

You can find reference here : https://developers.google.com/apps-script/guides/dialogs#file-open_dialogs

Stéphane