我第一次尝试google apps脚本并从google apps脚本文档运行以下脚本
function createAndSendDocument() {
// Create a new Google Doc named 'Hello, world!'
var doc = DocumentApp.create('Hello, world!');
// Access the body of the document, then add a paragraph.
doc.getBody().appendParagraph('This document was created by Google Apps Script.');
// Get the URL of the document.
var url = doc.getUrl();
// Get the email address of the active user - that's you.
var email = Session.getActiveUser().getEmail();
// Get the name of the document to use as an email subject line.
var subject = doc.getName();
// Append a new string to the "url" variable to use as an email body.
var body = 'Link to your doc: ' + url;
// Send yourself an email with a link to the document.
GmailApp.sendEmail(email, subject, body);
}
但是当我运行它时出现错误错误:在继续授权时出现invalid_client。
答案 0 :(得分:0)
此代码有效,您使用了哪些确切的程序?
你看到授权请求弹出了吗?您是否使用Gmail帐户登录?
是您在帖子中写的确切错误消息?
你能看看执行记录吗? (见下文)
答案 1 :(得分:0)
我收到同样的错误,我在https://code.google.com/p/google-apps-script-issues/issues/detail?id=3414发现了一个问题。看起来这会影响许多尝试授权新脚本的用户。
答案 2 :(得分:0)
它对我有用。