{"id":83,"date":"2024-09-24T22:23:47","date_gmt":"2024-09-24T13:23:47","guid":{"rendered":"https:\/\/u-san65.com\/?p=83"},"modified":"2024-09-25T10:43:24","modified_gmt":"2024-09-25T01:43:24","slug":"google-apps-script%ef%bc%88gas%e3%81%ab%e3%82%88%e3%82%8b%e8%87%aa%e5%8b%95%e3%83%a1%e3%83%bc%e3%83%ab%e8%bf%94%e4%bf%a1%e3%81%ae%e4%be%8b","status":"publish","type":"post","link":"https:\/\/u-san65.com\/?p=83","title":{"rendered":"Google Apps Script\uff08GAS)\u306b\u3088\u308b\u81ea\u52d5\u30e1\u30fc\u30eb\u8fd4\u4fe1\u306e\u4f8b"},"content":{"rendered":"\n<p>\u521d\u5fc3\u8005\u306a\u306e\u3067\u304a\u6065\u305a\u304b\u3057\u3044\u30b3\u30fc\u30c9\u3067\u3059\u304c\u3001Google Form\u306b\u9001\u4fe1\u3055\u308c\u305f\u3089\u81ea\u52d5\u3067\u304a\u793c\u30e1\u30fc\u30eb\u304c\u6765\u308b\u4f8b\u3092\u6295\u7a3f\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002\uff08\u304a\u4e16\u8a71\u306b\u306a\u3063\u3066\u3044\u308b\u65b9\u3078\u306e\u304a\u793c\u306e\u4ee3\u308f\u308a\u3067\u3059\uff09<\/p>\n\n\n\n<p>\u4e0a\u7d1a\u306e\u65b9\u306b\u76ee\u306b\u7559\u307e\u308a\u9593\u9055\u3048\u3066\u3044\u308b\u3068\u3053\u308d\u3084\u6539\u5584\u70b9\u3092\u6559\u3048\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3089\u5e78\u3044\u3067\u3059\u304c\u3001\u4e0b\u8a18\u306b\u30d5\u30a9\u30fc\u30e0\u4f8b\u306eURL\u3068\u30b3\u30fc\u30c9\u3068\u53c2\u8003URL\u3092\u63b2\u8f09\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSc3FEaLrN0xLJHVmjxD9eRrvhU3UE1Rmg4tuJiXhmTtnQ1xBQ\/viewform\">\u30d5\u30a9\u30fc\u30e0\u4f8b<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p style=\"font-size:12px\"><strong>\u30b3\u30fc\u30c9\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3067\u3059<\/strong>\uff08\u521d\u5fc3\u8005\u306a\u306e\u3067\u7a1a\u62d9\u3067\u304a\u6065\u305a\u304b\u3057\u3044\uff1b\u3054\u6307\u6458\u306f\u30b3\u30e1\u30f3\u30c8\u3044\u305f\u3060\u3051\u307e\u3057\u305f\u3089\u5e78\u3044\u3067\u3059\uff09<\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-gradient-2-gradient-background has-background has-x-large-font-size is-layout-flow wp-block-quote-is-layout-flow\">\n<p style=\"font-size:0.6rem\">\/\/GAS code \u3042\u307e\u308a\u3044\u3044\u30b3\u30fc\u30c9\u3067\u306a\u304f\u3066\u6065\u305a\u304b\u3057\u3044\u3067\u3059\u304c\u3001\u521d\u5fc3\u8005\u306a\u306e\u3067\u304a\u8a31\u3057\u304f\u3060\u3055\u3044<br>function myFunction() {<br>var spreadsheet = SpreadsheetApp.getActive();\/\/\u73fe\u30b7\u30fc\u30c8\u3092\u53d6\u5f97\u3059\u308b<br>spreadsheet.setActiveSheet(spreadsheet.getSheetByName(&#8216;\u30d5\u30a9\u30fc\u30e0\u306e\u56de\u7b54 1&#8217;), true);\/\/\u30d5\u30a9\u30fc\u30e0\u306e\u56de\u7b54 1\u3068\u3044\u3046\u30b7\u30fc\u30c8\u3092\u6307\u5b9a<br>var data = spreadsheet.getDataRange().getValues();\/\/data\u3092\u5b9a\u7fa9\u3059\u308b<br>let lastRow = spreadsheet.getLastRow(); \/\/ \u6700\u7d42\u884c\u3092\u53d6\u5f97\u3059\u308b<br>var affiliation = data[lastRow-1][2];\/\/\u6240\u5c5e\u3092\u898f\u5b9a\u3059\u308b<br>var name = data[lastRow-1][1];\/\/\u540d\u524d\u3092\u898f\u5b9a\u3059\u308b<br>var sendToAddress = data[lastRow-1][3];\/\/\u30e1\u30fc\u30eb\u306e\u9001\u308a\u5148\u3092\u898f\u5b9a\u3059\u308b<br>var mailTitle = &#8216;\u3010\u3054\u56de\u7b54\u306e\u304a\u793c\u3011\u30d1\u30fc\u30c6\u30a3\u30fc\u306e\u30a2\u30f3\u30b1\u30fc\u30c8\u3054\u56de\u7b54\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f&#8217;; \/\/ \u30e1\u30fc\u30eb\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u8a2d\u5b9a<br>var mailMessage = affiliation + &#8216; \\n\\n&#8217; + name + &#8216; \u69d8\\n\\n&#8217; + &#8216;\u30d1\u30fc\u30c6\u30a3\u30fc\u306e\u3054\u6848\u5185\u30a2\u30f3\u30b1\u30fc\u30c8\u306b\u3054\u5354\u529b\u304f\u3060\u3055\u308a\u307e\u3057\u3066\u3042\u308a\u3042\u3054\u3046\u3068\u3056\u3044\u307e\u3057\u305f\u3002\u72b6\u6cc1\u306f\u4e0b\u8a18\u306b\u5831\u544a\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002\\n\\n&#8217; + &#8216;URL\\n\\n&#8217; + &#8216;https:\/\/sites.google.com\/\u30fb\u30fb\u30fbdummy_\uff08\u3046\u305d\u306eURL\u3067\u3059\uff09\\n\\n&#8217; + &#8216;\u3067\u3059\u3002\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002&#8217; ;\/\/\u672c\u6587\u3092\u66f8\u304f<br>MailApp.sendEmail(sendToAddress, mailTitle, mailMessage);\/\/\u30e1\u30fc\u30eb\u306e\u4e0b\u66f8\u304d\u3092\u66f8\u304f(\u73fe\u6642\u70b9\uff09<br>\/\/\u9001\u4fe1\u30e1\u30fc\u30eb\u3092\u30c8\u30ea\u30ac\u30fc\u3068\u3057\u3066GAS\u304c\u5b9f\u884c\u3055\u308c\u308b\u304c\u3000\u30c8\u30ea\u30ac\u30fc\u4e0d\u4f5c\u52d5\u5bfe\u7b56\u306f\u4eca\u306f\u3057\u3066\u3044\u306a\u3044<br>}<\/p>\n<\/blockquote>\n\n\n\n<p>\u53c2\u8003URL<\/p>\n\n\n\n<p><a href=\"https:\/\/feynman.co.jp\/it-tool-takumi\/gas-auto-reply-email-from-google-forms\">https:\/\/feynman.co.jp\/it-tool-takumi\/gas-auto-reply-email-from-google-forms<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/feynman.co.jp\/it-tool-takumi\/gas-auto-reply-email-from-google-forms\">https:\/\/feynman.co.jp\/it-tool-takumi\/gas-auto-reply-email-from-google-forms<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/tonari-it.com\/gas-script-approval\">https:\/\/tonari-it.com\/gas-script-approval<\/a><\/p>\n\n\n\n<p>\u7b49\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\uff08\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff09<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u4e0d\u6163\u308c\u306a\u3082\u306e\u3067\u3059\u307f\u307e\u305b\u3093\u3000\u4eca\u5ea6\u306fMicrosoft Forms \uff0bPower Automate\u3000\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u63b2\u8f09\u3067\u304d\u305f\u3089\u3044\u3044\u306a\u3068\u601d\u3044\u307e\u3059<\/p>\n\n\n\n<p style=\"font-size:13px\">WordPress\u81ea\u4f53\u3082\u4e0d\u6163\u308c\u3067\u3059\u307f\u307e\u305b\u3093<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u521d\u5fc3\u8005\u306a\u306e\u3067\u304a\u6065\u305a\u304b\u3057\u3044\u30b3\u30fc\u30c9\u3067\u3059\u304c\u3001Google Form\u306b\u9001\u4fe1\u3055\u308c\u305f\u3089\u81ea\u52d5\u3067\u304a\u793c\u30e1\u30fc\u30eb\u304c\u6765\u308b\u4f8b\u3092\u6295\u7a3f\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002\uff08\u304a\u4e16\u8a71\u306b\u306a\u3063\u3066\u3044\u308b\u65b9\u3078\u306e\u304a\u793c\u306e\u4ee3\u308f\u308a\u3067\u3059\uff09 \u4e0a\u7d1a\u306e\u65b9\u306b\u76ee\u306b\u7559\u307e\u308a\u9593\u9055\u3048\u3066\u3044\u308b\u3068\u3053\u308d\u3084\u6539\u5584\u70b9\u3092 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/u-san65.com\/index.php?rest_route=\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/u-san65.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/u-san65.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/u-san65.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/u-san65.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=83"}],"version-history":[{"count":8,"href":"https:\/\/u-san65.com\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":95,"href":"https:\/\/u-san65.com\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions\/95"}],"wp:attachment":[{"href":"https:\/\/u-san65.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/u-san65.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/u-san65.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}