{"id":4266,"date":"2014-03-14T17:40:54","date_gmt":"2014-03-14T08:40:54","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=4266"},"modified":"2014-03-14T17:40:54","modified_gmt":"2014-03-14T08:40:54","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%e4%b8%8a%e3%81%ab%e3%82%a6%e3%82%a3%e3%83%b3%e3%83%89%e3%82%a6%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=4266","title":{"rendered":"[Google Apps Script]\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u4e0a\u306b\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8868\u793a\u3059\u308b"},"content":{"rendered":"<ul>\n<li>Google Apps Script\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u4e0a\u306b\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/li>\n<li>\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5185\u5bb9\u306f<span style=\"color: #ff0000; font-weight: bold;\">createHtmlOutputFromFile<\/span>\u30e1\u30bd\u30c3\u30c9\u3067HTML\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<li><span style=\"color: #ff0000; font-weight: bold;\">setValue<\/span>\u30e1\u30bd\u30c3\u30c9\u3067\u30bb\u30eb\u306b\u5024\u3092\u5165\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">var app = SpreadsheetApp;\r\n\r\nfunction onOpen(e){\r\n    showContentApp();\r\n}\r\n\r\nfunction showContentApp(){\r\n    var html = HtmlService.createHtmlOutputFromFile('Contents').setTitle('Sample App').setWidth(300).setHeight(250);\r\n    app.getActiveSpreadsheet().show(html);\r\n}\r\n\r\nfunction setRangeValue(arg){\r\n    app.getActiveRange().setValue(arg);\r\n}<\/pre>\n<p><strong>\u30fbContents.html<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;link rel=&quot;stylesheet&quot; href=&quot;https:\/\/ssl.gstatic.com\/docs\/script\/css\/add-ons.css&quot;&gt;\r\n&lt;script src=&quot;\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.11.0\/jquery.min.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\n    $(function(){\r\n        $('#btnOK').click(function(){\r\n            google.script.run.setRangeValue('Hello world.');\r\n        });\r\n    });\r\n&lt;\/script&gt;\r\n&lt;p&gt;&lt;button id=&quot;btnOK&quot; class=&quot;action&quot;&gt;OK&lt;\/button&gt;&lt;\/p&gt;<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_03_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_03_01.jpg\" alt=\"GoogleAppsScript_03_01\" width=\"531\" height=\"505\" class=\"alignnone size-full wp-image-4267\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_03_01.jpg 531w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_03_01-300x285.jpg 300w\" sizes=\"auto, (max-width: 531px) 100vw, 531px\" \/><\/a><\/p>\n<ul>\n<li>show(userInterface)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/spreadsheet\/spreadsheet?hl=ja#show%28Object%29\" target=\"_blank\" title=\"show(userInterface)\">https:\/\/developers.google.com\/apps-script\/reference\/spreadsheet\/spreadsheet?hl=ja#show%28Object%29<\/a><\/li>\n<li>getActiveRange()<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/spreadsheet\/spreadsheet?hl=ja#getActiveRange%28%29\" target=\"_blank\" title=\"getActiveRange()\">https:\/\/developers.google.com\/apps-script\/reference\/spreadsheet\/spreadsheet?hl=ja#getActiveRange%28%29<\/a><\/li>\n<li>setValue(value)<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/spreadsheet\/range?hl=ja#setValue%28Object%29\" target=\"_blank\" title=\"setValue(value)\">https:\/\/developers.google.com\/apps-script\/reference\/spreadsheet\/range?hl=ja#setValue%28Object%29<\/a><\/li>\n<\/ul>\n<h4>\u3010\u7de8\u96c6\u5f8c\u8a18\u3011<\/h4>\n<p>\u5148\u65e5\u304b\u3089Google Apps Script(GAS)\u3092\u89e6\u308a\u59cb\u3081\u307e\u3057\u305f\u3002<br \/>\n\u307e\u3060\u307e\u3060\u5206\u304b\u3089\u306a\u3044\u3053\u3068\u3060\u3089\u3051\u3067\u3059\u304c\u3001\u3068\u308a\u3042\u3048\u305aOffice \u7528\u30a2\u30d7\u30ea\u3068\u540c\u3058\u3088\u3046\u306a\u3053\u3068\u3092GAS\u3067\u3082\u51fa\u6765\u308b\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u3001\u8272\u3005\u8a66\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306e\u8a18\u4e8b\u306fOffice \u7528\u30a2\u30d7\u30ea\u3067\u3044\u3046\u3068\u3053\u308d\u306e\u300c<span style=\"color: #ff0000; font-weight: bold;\">\u30b3\u30f3\u30c6\u30f3\u30c4 \u30a2\u30d7\u30ea<\/span>\u300d\u306b\u3042\u305f\u308a\u307e\u3059\u3002<br \/>\n\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8868\u793a\u3059\u308bshow\u30e1\u30bd\u30c3\u30c9\u3067\u306fUiInstance\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3082\u8868\u793a\u51fa\u6765\u308b\u307f\u305f\u3044\u306a\u306e\u3067\u3059\u304c\u3001\u3044\u3061\u3044\u3061\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u305f\u308a\u30e9\u30d9\u30eb\u3092\u8ffd\u52a0\u3057\u305f\u308a\u3068\u3044\u3046\u306e\u304c\u9762\u5012\u3060\u3063\u305f\u306e\u3067\u3001Office \u7528\u30a2\u30d7\u30ea\u3068\u540c\u69d8HTML\u304b\u3089\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5\u3092\u63a1\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n(\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u304c\u3053\u308c\u3067\u5408\u3063\u3066\u3044\u308b\u306e\u304b\u751a\u3060\u7591\u554f\u3067\u3059\u304c\u3001\u3068\u308a\u3042\u3048\u305a\u52d5\u304f\u306e\u3067\u826f\u3057\u3068\u3057\u3066\u3044\u307e\u3059\u3002)<\/p>\n","protected":false},"excerpt":{"rendered":"Google Apps Script\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u4e0a\u306b\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5185\u5bb9\u306fcreateHtmlOutputFromFile\u30e1\u30bd\u30c3\u30c9\u3067HTML\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 setValu [&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-4266","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-16O","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4266","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=4266"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4266\/revisions"}],"predecessor-version":[{"id":4268,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4266\/revisions\/4268"}],"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=4266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}