1

I would like to send at a given time (from cell in google sheet) a text command to my Google assistant (on google home) to play music or do another action.

I tried this tutorial and I'm now able to send email at a given time https://developers.google.com/apps-script/articles/sending_emails

Is there a possibility to send a text-command instead of sending an email.

Here is the code used:

/**
 * Sends emails with data from the current spreadsheet.
 */
function sendEmails() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var startRow = 2; // First row of data to process
  var numRows = 2; // Number of rows to process
  // Fetch the range of cells A2:B3
  var dataRange = sheet.getRange(startRow, 1, numRows, 2);
  // Fetch values for each row in the Range.
  var data = dataRange.getValues();
  for (var i in data) {
    var row = data[i];
    var emailAddress = row[0]; // First column
    var message = row[1]; // Second column
    var subject = 'Sending emails from a Spreadsheet';
    MailApp.sendEmail(emailAddress, subject, message);
  }
}
Rubén
  • 34,714
  • 9
  • 70
  • 166
Manref
  • 21
  • 2
  • 1
    Welcome to [so]. You included a link to a resource about sending emails but didn't mention any search/research effort about sending a text-command. Have you already look at the Google Advanced Services and the URL Fetch Service? How about searching for similar questions on this site? – Rubén Jun 09 '20 at 13:12
  • It's not particularly feasible to programmatically get your Google Home to start playing music from a command. – Nick Felker Jun 09 '20 at 16:08
  • Try it with UrlFetchApp. Let us know how it works. – Cooper Jun 09 '20 at 19:43
  • Hi all, thanks for the answers. @Rubén I had a look here but no similar questions or solutions. to Nick Felker is there a soluation? to Cooper I had a look on this. but I don't know how this may help. – Manref Jun 11 '20 at 09:28
  • @Cooper i tried yesterday and didn't understand how can I use UrlFetchApp to send a text command to my Google Home Mini. If you know an example, please let me know. – Manref Jun 12 '20 at 08:58

0 Answers0