{"id":4249,"date":"2014-03-13T23:46:22","date_gmt":"2014-03-13T14:46:22","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=4249"},"modified":"2014-03-14T17:37:37","modified_gmt":"2014-03-14T08:37:37","slug":"google-apps-script%e3%83%a1%e3%83%8b%e3%83%a5%e3%83%bc%e3%81%ae%e8%bf%bd%e5%8a%a0%e3%81%a8%e7%a2%ba%e8%aa%8d%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%81%ae%e8%a1%a8%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=4249","title":{"rendered":"[Google Apps Script]\u30e1\u30cb\u30e5\u30fc\u306e\u8ffd\u52a0\u3068\u78ba\u8a8d\u30c0\u30a4\u30a2\u30ed\u30b0\u306e\u8868\u793a"},"content":{"rendered":"<p>Google Apps Script\u3067\u65b0\u898f\u30e1\u30cb\u30e5\u30fc\u3092\u8ffd\u52a0\u3057\u3001\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u95a2\u6570\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<br \/>\n\u300c<span style=\"color: #ff0000; font-weight: bold;\">onOpen<\/span>\u300d\u306f\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3084\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3001\u30d5\u30a9\u30fc\u30e0\u304c\u958b\u304b\u308c\u305f\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\/\/var ui = SpreadsheetApp.getUi();\r\nvar ui = DocumentApp.getUi();\r\n\r\nfunction onOpen(e){\r\n    ui.createMenu('\u30b5\u30f3\u30d7\u30eb \u30e1\u30cb\u30e5\u30fc').addItem('\u30c0\u30a4\u30a2\u30ed\u30b0\u8868\u793a', 'showAlert').addToUi();\r\n}\r\n\r\nfunction showAlert(){\r\n    var result = ui.alert(\r\n        '\u30b5\u30f3\u30d7\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0',\r\n        '\u51e6\u7406\u3092\u7d9a\u3051\u307e\u3059\u304b\uff1f',\r\n        ui.ButtonSet.YES_NO);\r\n    \r\n    if(result == ui.Button.YES){\r\n        ui.alert('\u300c\u306f\u3044\u300d\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u307e\u3057\u305f\u3002');\r\n    }else{\r\n        ui.alert('\u300c\u3044\u3044\u3048\u300d\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u307e\u3057\u305f\u3002');\r\n    }\r\n}<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_01.jpg\" alt=\"GoogleAppsScript_01_01\" width=\"515\" height=\"149\" class=\"alignnone size-full wp-image-4251\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_01.jpg 515w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_01-300x86.jpg 300w\" sizes=\"auto, (max-width: 515px) 100vw, 515px\" \/><\/a><\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_02.jpg\" alt=\"GoogleAppsScript_01_02\" width=\"421\" height=\"205\" class=\"alignnone size-full wp-image-4252\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_02.jpg 421w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_02-300x146.jpg 300w\" sizes=\"auto, (max-width: 421px) 100vw, 421px\" \/><\/a><\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_03.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_03.jpg\" alt=\"GoogleAppsScript_01_03\" width=\"422\" height=\"181\" class=\"alignnone size-full wp-image-4253\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_03.jpg 422w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_01_03-300x128.jpg 300w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/a><\/p>\n<ul>\n<li>Understanding Triggers<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/understanding_triggers?hl=ja\" target=\"_blank\" title=\"Understanding Triggers\">https:\/\/developers.google.com\/apps-script\/understanding_triggers?hl=ja<\/a><\/li>\n<li>getUi()<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/document\/document-app?hl=ja#getUi%28%29\" target=\"_blank\" title=\"getUi()\">https:\/\/developers.google.com\/apps-script\/reference\/document\/document-app?hl=ja#getUi%28%29<\/a><\/li>\n<li>createMenu(caption)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/base\/ui?hl=ja#createMenu%28String%29\" target=\"_blank\" title=\"createMenu(caption)\">https:\/\/developers.google.com\/apps-script\/reference\/base\/ui?hl=ja#createMenu%28String%29<\/a><\/li>\n<li>addItem(caption, function)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/base\/menu?hl=ja#addItem%28String,String%29\" target=\"_blank\" title=\"addItem(caption, function)\">https:\/\/developers.google.com\/apps-script\/reference\/base\/menu?hl=ja#addItem%28String,String%29<\/a><\/li>\n<li>addToUi()<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/base\/menu?hl=ja#addToUi%28%29\" target=\"_blank\" title=\"addToUi()\">https:\/\/developers.google.com\/apps-script\/reference\/base\/menu?hl=ja#addToUi%28%29<\/a><\/li>\n<li>alert(title, prompt, buttons)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/base\/ui?hl=ja#alert%28String,String,ButtonSet%29\" target=\"_blank\" title=\"alert(title, prompt, buttons)\">https:\/\/developers.google.com\/apps-script\/reference\/base\/ui?hl=ja#alert%28String,String,ButtonSet%29<\/a><\/li>\n<li>Enum ButtonSet<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/base\/button-set?hl=ja\" target=\"_blank\" title=\"Enum ButtonSet\">https:\/\/developers.google.com\/apps-script\/reference\/base\/button-set?hl=ja<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"Google Apps Script\u3067\u65b0\u898f\u30e1\u30cb\u30e5\u30fc\u3092\u8ffd\u52a0\u3057\u3001\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u95a2\u6570\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002 \u300conOpen\u300d\u306f\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3084\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3001\u30d5\u30a9\u30fc\u30e0\u304c\u958b\u304b\u308c\u305f\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002 \/\/var u [&hellip;]","protected":false},"author":1,"featured_media":7113,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[126],"tags":[],"class_list":["post-4249","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-16x","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4249","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=4249"}],"version-history":[{"count":3,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4249\/revisions"}],"predecessor-version":[{"id":4265,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4249\/revisions\/4265"}],"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=4249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}