0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

何回やっても何回やってもカレンダーオブジェクトが取得できないYO編

Posted at

備忘録として記録

カレンダー絡みのコード書く時に「日本の祝日」とか取りたいなとかあって
グーグル先生で検索して出てくるよくあるコード

例えばこんな感じのね

function hoge() {
  const id = "ja.japanese#holiday@group.v.calendar.google.com";
  const cal = CalendarApp.getCalendarById(id);
  console.log(cal)
}

ログ見るとカレンダーが~~ヌルヌルさん~~NULLですよ
もうね、アホかと。馬鹿かと。
他人様が書いたコードのコピペが何故動かんのかと!
問いたい、問い詰めたい。小一時間問い詰めたい。

あー、なんでやねん:confounded:とかいうてると
ふと思い出す。
あー、権限設定ダイアログ出たけど
こっちにも設定せんとあかんやんと!

というわけで下記の内容を追加ですよ

AppleScript.json
//前略
  "oauthScopes": [
    "https://www.googleapis.com/auth/calendar.readonly"
  ]
//後略

やったぜ!父ちゃん。
明日もホームランや!
無事取得!
嗚呼、感無量、僥倖、至福、圧倒的達成

検索に出てきたサンプル達に圧倒的感謝を捧げつつ、
頼むから設定も一緒に入れといて頂きたいと切に希望するものであります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?