2015-06-18 49 views
0

我不寫與谷歌FormApp代碼,大家都知道的表的權限,每個表單有一個目標表,我想打開SpreadsheetApp:不必操作谷歌形態目標

var destId = FormApp.getActiveForm().getDestinationId(); 
var ss = SpreadsheetApp.openById(destId); 

但是我有一個警告,「你沒有權限openById」,這意味着我無法打開在FormApp的腳本的電子表格?

或者是有什麼錯我的代碼?

附:我正在編寫基於「谷歌形式通知」的代碼。

謝謝!

+0

支票本的其他問題:http://stackoverflow.com/questions/22664183/google-script-error-you-do-not-have-permission-to-呼叫openbyid – Gerardo

回答

2

刪除代碼@OnlyCurrentDoc

/** 
* @OnlyCurrentDoc 
* 
* The above comment directs Apps Script to limit the scope of file 
* access for this add-on. It specifies that this add-on will only 
* attempt to read or modify the files in which the add-on is used, 
* and not all of the user's files. The authorization request message 
* presented to users will reflect this limited scope. 
*/