在 google 脚本中添加自动完成电子邮件地址列表

Adding autocomplete email address list in google script

我正在尝试在我的函数中添加自动完成列表电子邮件。现在,我手动输入电子邮件地址,所以我必须全部写入或复制。如果有自动完成功能应该会更有效率。这是我的代码示例:

function getemail(){

  var ui_user = SpreadsheetApp.getUi();

  var result = ui_user.prompt("Enter Receiver Email:");
  return result.getResponseText();

}

GAS可以搜索我们的联系人邮箱然后全部查询吗?

是的,Google Apps 脚本可用于通过 Contacts Service but it's not possible to add autocomplete feature the Spreadsheet.Ui.prompt. In order to have that feature you will have to create a dialog by using HTML Service, client side code (HTML/CSS/JavaScript) and communicate this code with server code.

搜索联系人