こんにちは。
Google Apps Scriptで以下のようにHTMLファイルを記述し, 実行すると以下エラー文が出ました.
html
1<!DOCTYPE html> 2<html> 3 <head> 4 <base target="_top"> 5 </head> 6 <body> 7 <h1>こんにちは</h1> 8 <input type="button" id="firstButton" value="1"> 9 <input type="button" value="2" onclick="history.back()"> 10 <input type="button" value="3" onclick="history.back()"> 11 <input type="button" value="4" onclick="history.back()"> 12 <ul> 13 <? 14 var myData = SpreadsheetApp.getActiveSheet().getDataRange().getValues(); 15 for(var i=0;i<myData.length;i++){ 16 output.append('<li>' + myData[i][0] + '</li>'); 17 } 18 ?> 19 </ul> 20 </body> 21</html>
error
1SpreadsheetApp.getActiveSheet を呼び出す権限がありません。必要な権限: (https://www.googleapis.com/auth/spreadsheets.currentonly || https://www.googleapis.com/auth/spreadsheets)(行 2、ファイル「コード」、プロジェクト「テスト」)
そこで,【GAS】「SpreadsheetApp.create を呼び出す権限がありません」を解決する
を参考にappsscript.jsonに以下のように記述し, 保存を試みたところ以下の構文エラーが出ました.
appsscript.json
1{ 2 "timeZone": "Asia/Tokyo", 3 "dependencies": { 4 }, 5 "webapp": { 6 "access": "ANYONE_ANONYMOUS", 7 "executeAs": "USER_DEPLOYING" 8 }, 9 "exceptionLogging": "STACKDRIVER" 10 "oauthScopes": ["https://www.googleapis.com/auth/spreadsheets.readonly"], 11}
error
1Unexpected character ('"' (code 34)): was expecting comma to separate Object entries at [Source: (String)"{ "timeZone":
どうしたら解決できるでしょうか. よろしくお願い致します。
追記
maisumakun様の回答の通りコンマを追加したところ以下のエラーが出ました.
error
1Unexpected character ('}' (code 125)): was expecting double-quote to start field name at [Source: (String)"{ "timeZone":
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/11/25 05:17
2019/11/25 05:21
2019/11/25 05:23