{"id":12812,"date":"2020-05-18T15:06:50","date_gmt":"2020-05-18T06:06:50","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=12812"},"modified":"2020-05-18T15:06:50","modified_gmt":"2020-05-18T06:06:50","slug":"google-apps-script%e3%82%b9%e3%83%97%e3%83%ac%e3%83%83%e3%83%89%e3%82%b7%e3%83%bc%e3%83%88%e3%81%a7%e9%81%b8%e6%8a%9e%e7%af%84%e5%9b%b2%e3%82%92%e5%a4%89%e6%9b%b4%e3%81%97%e3%81%9f%e3%81%a8%e3%81%8d","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=12812","title":{"rendered":"[Google Apps Script]\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3067\u9078\u629e\u7bc4\u56f2\u3092\u5909\u66f4\u3057\u305f\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u308bonSelectionChange\u30c8\u30ea\u30ac\u30fc"},"content":{"rendered":"<p>\u4e0b\u8a18\u30ea\u30ea\u30fc\u30b9\u30ce\u30fc\u30c8\u306b\u3042\u308b\u901a\u308a\u30014\u6708\u306eGoogle Apps Script\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u300c<a href=\"https:\/\/developers.google.com\/apps-script\/guides\/triggers#onselectionchangee\" title=\"Simple Triggers  |  Apps Script  |  Google Developers\" target=\"_blank\" rel=\"noopener noreferrer\">onSelectionChange<\/a>\u300d\u30c8\u30ea\u30ac\u30fc\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"lkc-link no_icon\" href=\"https:\/\/developers.google.com\/apps-script\/releases\/\" target=\"_blank\" rel=\"external nofollow noopener\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=developers.google.com\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">Google Developers<\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/pz-linkcard\/cache\/324a8815a224c9a9b2b845bbb83575a5163260034a46409392645a1b21b7d6fd.jpeg\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">Release Notes &nbsp;|&nbsp; Apps Script &nbsp;|&nbsp; Google Developers<\/div><div class=\"lkc-url\" title=\"https:\/\/developers.google.com\/apps-script\/releases\/\">https:\/\/developers.google.com\/apps-script\/releases\/<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<p>\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u958b\u304f\u306a\u3069\u3001\u7279\u5b9a\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u3001\u81ea\u52d5\u7684\u306b\u4e88\u7d04\u6e08\u307f\u306e\u7d44\u8fbc\u307f\u95a2\u6570\u304c\u5b9f\u884c\u3055\u308c\u308b\u4ed5\u7d44\u307f\u3092\u30b7\u30f3\u30d7\u30eb\u30c8\u30ea\u30ac\u30fc(Simple Triggers)\u3068\u547c\u3073\u307e\u3059\u304c\u3001onSelectionChange\u3082\u3053\u306e\u30b7\u30f3\u30d7\u30eb\u30c8\u30ea\u30ac\u30fc\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u9078\u629e\u7bc4\u56f2\u3092\u5909\u66f4\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4e0b\u8a18\u306f\u9078\u629e\u3057\u3066\u3044\u308b\u30bb\u30eb\u306e\u5024\u3092\u30a2\u30e9\u30fc\u30c8\u8868\u793a\u3059\u308b\u3060\u3051\u306e\u30b3\u30fc\u30c9\u3067\u3059\u304c\u3001\u3053\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u305f\u72b6\u614b\u3067\u9078\u629e\u7bc4\u56f2\u3092\u5909\u66f4\u3059\u308b\u3068\u3001\u81ea\u52d5\u7684\u306b\u95a2\u6570\u304c\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">function onSelectionChange(e) {\r\n  SpreadsheetApp.getUi().alert(e.range.getCell(1, 1).getValue());\r\n}<\/pre>\n<p><a href=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_SpreadSheet_onSelectionChange_.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_SpreadSheet_onSelectionChange_.gif\" alt=\"\" width=\"565\" height=\"430\" class=\"alignnone size-full wp-image-12813\" \/><\/a><\/p>\n<p>\u30e1\u30cb\u30e5\u30fc\u3084\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3053\u3068\u306a\u304f\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u5b9f\u884c\u3067\u304d\u308b\u306e\u306f\u4fbf\u5229\u3067\u3059\u304c\u3001\u9078\u629e\u30bb\u30eb\u3092\u5909\u66f4\u3059\u308b\u5ea6\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u8d70\u308b\u3068\u3001\u51e6\u7406\u304c\u91cd\u304f\u306a\u308a\u305d\u3046\u3067\u3059\u3002<br \/>\n(\u8a08\u6e2c\u3057\u305f\u3053\u3068\u304c\u7121\u3044\u306e\u3067\u5b9f\u969b\u306f\u5206\u304b\u308a\u307e\u305b\u3093\u304c\u30fb\u30fb\u30fb)<\/p>\n<p>\u4f7f\u3044\u3069\u3053\u308d\u304c\u4e2d\u3005\u96e3\u3057\u3044\u306a\u3001\u3068\u500b\u4eba\u7684\u306b\u306f\u601d\u3044\u307e\u3059\u304c\u3001<a href=\"https:\/\/developers.google.com\/apps-script\/guides\/dialogs\" title=\"Dialogs and Sidebars in G Suite Documents  |  Apps Script\" target=\"_blank\" rel=\"noopener noreferrer\">\u30b5\u30a4\u30c9\u30d0\u30fc<\/a>\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u3001\u5024\u306e\u8aad\u307f\u66f8\u304d\u304c\u7c21\u5358\u306b\u3067\u304d\u308b\u306e\u3067\u4fbf\u5229\u306a\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u540c\u69d8\u306e\u4ed5\u7d44\u307f\u306fOffice \u30a2\u30c9\u30a4\u30f3\u3067\u3082\u300c<a href=\"https:\/\/docs.microsoft.com\/ja-jp\/javascript\/api\/office\/office.documentselectionchangedeventargs?view=word-js-preview\" title=\"Office.DocumentSelectionChangedEventArgs interface - Office Add-ins | Microsoft Docs\" target=\"_blank\" rel=\"noopener noreferrer\">SelectionChanged<\/a>\u300d\u30a4\u30d9\u30f3\u30c8\u3068\u3057\u3066\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u79c1\u304c\u30c6\u30b9\u30c8\u3057\u305f\u9650\u308a\u3067\u306f\u3001\u73fe\u6642\u70b9(2020\u5e745\u6708)\u3067\u306f\u74b0\u5883\u306b\u3088\u3063\u3066onSelectionChange\u304c\u52d5\u3044\u305f\u308a\u52d5\u304b\u306a\u304b\u3063\u305f\u308a\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u540c\u3058\u74b0\u5883\u3067\u3082\u6628\u65e5\u52d5\u3044\u3066\u3044\u305f\u30b3\u30fc\u30c9\u304c\u7fcc\u65e5\u52d5\u304b\u306a\u304f\u306a\u3063\u305f\u308a\u3001\u3088\u304f\u5206\u304b\u3089\u306a\u3044\u6319\u52d5\u304c\u7d9a\u3044\u3066\u3044\u307e\u3059\u304c\u3001\u6700\u521d\u306b\u66f8\u3044\u305f\u901a\u308a\u5b9f\u88c5\u3055\u308c\u305f\u3070\u304b\u308a\u306e\u6a5f\u80fd\u306a\u306e\u3067\u3001\u307e\u3060\u5b8c\u5168\u306b\u30ed\u30fc\u30eb\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>Stack Overflow\u3067\u3082\u540c\u69d8\u306e\u5831\u544a\u304c\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"lkc-link no_icon\" href=\"https:\/\/stackoverflow.com\/questions\/61408971\/what-am-i-doing-wrong-when-using-onselectionchange-for-google-apps-script\" target=\"_blank\" rel=\"external nofollow noopener\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=stackoverflow.com\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">Stack Overflow<\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/pz-linkcard\/cache\/93927fc1e64dd3e5b86b87f2a89b3b29bc3a30e0e6b7a2312393a2a6226faaba.jpeg\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">What am I doing wrong when using onSelectionChange for [google-apps-script]<\/div><div class=\"lkc-url\" title=\"https:\/\/stackoverflow.com\/questions\/61408971\/what-am-i-doing-wrong-when-using-onselectionchange-for-google-apps-script\">https:\/\/stackoverflow.com\/questions\/61408971\/what-am-i-doing-wrong-when-using-onselectionchange-for-google-apps-script<\/div><div class=\"lkc-excerpt\">I found this trigger onSelectionChange(e) on developers.google.com it should set background to red if a single empty cell is selected. Im not getting that result with just copy and paste. I don&#x27;t t...<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<div id=\"single_banner_area2\" class=\"clearfix one_banner\">\n<div class=\"single_banner single_banner_left\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u8a18\u4e8b\u4e2d(\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u5e83\u544a\u30e6\u30cb\u30c3\u30c8) -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-7306936664602087\"\r\n     data-ad-slot=\"5429724765\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<\/div>\n<div class=\"single_banner single_banner_right\">\n<a href=\"\" target=\"_blank\"><img decoding=\"async\" src=\"\" alt=\"\" title=\"\" \/><\/a>\n<\/div>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"\u4e0b\u8a18\u30ea\u30ea\u30fc\u30b9\u30ce\u30fc\u30c8\u306b\u3042\u308b\u901a\u308a\u30014\u6708\u306eGoogle Apps Script\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u300conSelectionChange\u300d\u30c8\u30ea\u30ac\u30fc\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002 \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u958b\u304f\u306a\u3069\u3001\u7279\u5b9a\u306e\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3057\u305f [&hellip;]","protected":false},"author":1,"featured_media":7113,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"[[Google Apps Script]\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3067\u9078\u629e\u7bc4\u56f2\u3092\u5909\u66f4\u3057\u305f\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u308bonSelectionChange\u30c8\u30ea\u30ac\u30fc]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[126],"tags":[],"class_list":["post-12812","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Google.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-3kE","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12812"}],"version-history":[{"count":3,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12812\/revisions"}],"predecessor-version":[{"id":12816,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12812\/revisions\/12816"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7113"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}