{"id":10878,"date":"2018-09-12T15:00:11","date_gmt":"2018-09-12T06:00:11","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=10878"},"modified":"2018-09-12T16:02:42","modified_gmt":"2018-09-12T07:02:42","slug":"google-apps-scriptgoogle-%e3%83%89%e3%83%a9%e3%82%a4%e3%83%96%e3%81%ab%e3%81%82%e3%82%8b%e7%94%bb%e5%83%8f%e3%82%92%e3%82%b9%e3%83%a9%e3%82%a4%e3%83%89%e3%81%ab%e6%8c%bf%e5%85%a5%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=10878","title":{"rendered":"[Google Apps Script]Google \u30c9\u30e9\u30a4\u30d6\u306b\u3042\u308b\u753b\u50cf\u3092\u30b9\u30e9\u30a4\u30c9\u306b\u633f\u5165\u3059\u308b"},"content":{"rendered":"<p>\u6700\u8fd1\u53d6\u308a\u6271\u3063\u3066\u3044\u308bGoogle Apps Script\u306b\u3088\u308bGoogle \u30b9\u30e9\u30a4\u30c9\u64cd\u4f5c\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u3088\u308aGAS\u3089\u3057\u304f<span style=\"color: #ff0000; font-weight: bold;\">\u201cGoogle \u30c9\u30e9\u30a4\u30d6\u306b\u3042\u308b\u753b\u50cf\u3092\u30b9\u30e9\u30a4\u30c9\u306b\u633f\u5165\u3059\u308b\u201d<\/span>\u51e6\u7406\u3092\u884c\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u969b\u3001\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308bGoogle \u30c9\u30e9\u30a4\u30d6\u306e\u30d5\u30a9\u30eb\u30c0ID\u3092\u8abf\u3079\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001<a href=\"https:\/\/twitter.com\/ntakahashi0505\" title=\"\u30bf\u30ab\u30cf\u30b7\u30ce\u30ea\u30a2\u30adGAS\u672c\u767a\u58f2\u4e2d\uff01(@ntakahashi0505)\u3055\u3093\" target=\"_blank\">\u30bf\u30ab\u30cf\u30b7<\/a>\u3055\u3093\u306e<a href=\"https:\/\/tonari-it.com\/\" title=\"\u3044\u3064\u3082\u96a3\u306bIT\u306e\u304a\u4ed5\u4e8b | \u6bce\u65e5\u306e\u696d\u52d9\u304c\u697d\u30c1\u30f3\u306b\uff01\" target=\"_blank\">\u30b5\u30a4\u30c8<\/a>\u306b\u8a73\u3057\u3044\u8aac\u660e\u304c\u8f09\u3063\u3066\u3044\u307e\u3057\u305f\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><div class=\"lkc-unlink\"><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=tonari-it.com\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">tonari-it.com<\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"https:\/\/s.wordpress.com\/mshots\/v1\/https%3A%2F%2Ftonari-it.com%2Fgas-google-drive-file-folder-id%2F?w=100\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">https:\/\/tonari-it.com\/gas-google-drive-file-folder-id\/<\/div><div class=\"lkc-url\" title=\"https:\/\/tonari-it.com\/gas-google-drive-file-folder-id\/\"><strike>https:\/\/tonari-it.com\/gas-google-drive-file-folder-id\/<\/strike><\/div><\/div><div class=\"clear\"><\/div><\/div><\/div><\/div><\/div>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">function myFunction() {\r\n  \/* \u8981\u5909\u66f4 *\/\r\n  const folder_id = &quot;(Google \u30c9\u30e9\u30a4\u30d6\u306e\u30d5\u30a9\u30eb\u30c0ID)&quot;; \/\/\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u30d5\u30a9\u30eb\u30c0\u306eID\r\n  const image_name = &quot;iai_battou_woman.png&quot;; \/\/\u633f\u5165\u3059\u308b\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u540d\r\n  \r\n  var fol = DriveApp.getFolderById(folder_id);\r\n  var image = fol.getFilesByName(image_name).next(); \/\/\u540d\u524d\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u53d6\u5f97\r\n  var prs = SlidesApp.getActivePresentation();\r\n  var slide = prs.appendSlide(SlidesApp.PredefinedLayout.BLANK); \/\/\u65b0\u898f\u7a7a\u767d\u30b9\u30e9\u30a4\u30c9\u8ffd\u52a0\r\n  slide.insertImage(image.getBlob()); \/\/\u30d5\u30a1\u30a4\u30eb\u304b\u3089Blob\u53d6\u5f97\u2192\u753b\u50cf\u3068\u3057\u3066\u633f\u5165\r\n  \r\n  SlidesApp.getUi().alert(&quot;\u51e6\u7406\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002&quot;);\r\n}<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u65b0\u3057\u3044\u7a7a\u767d\u306e\u30b9\u30e9\u30a4\u30c9\u3092\u8ffd\u52a0\u3057\u3001\u305d\u306e\u4e0a\u306bGoogle \u30c9\u30e9\u30a4\u30d6\u306e\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u3042\u308b\u3001\u6307\u5b9a\u3057\u305f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u633f\u5165\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_Slides_04_01.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_Slides_04_01.gif\" alt=\"\" width=\"693\" height=\"477\" class=\"alignnone size-full wp-image-10879\" \/><\/a><\/p>\n<p>\u5927\u307e\u304b\u306a\u51e6\u7406\u306e\u6d41\u308c\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/drive\/drive-app#getFolderById(String)\" title=\"Class DriveApp  |  Apps Script  |  Google Developers\" target=\"_blank\">DriveApp.getFolderById<\/a>\u30e1\u30bd\u30c3\u30c9\u3067\u30d5\u30a9\u30eb\u30c0\u53d6\u5f97<br \/>\n\u2193<br \/>\n<a href=\"https:\/\/developers.google.com\/apps-script\/reference\/drive\/folder#getFilesByName(String)\" title=\"Class Folder  |  Apps Script  |  Google Developers\" target=\"_blank\">Folder.getFilesByName<\/a>\u30e1\u30bd\u30c3\u30c9\u3067FileIterator\u53d6\u5f97<br \/>\n\u2193<br \/>\n<a href=\"https:\/\/developers.google.com\/apps-script\/reference\/drive\/file-iterator#next()\" title=\"Class FileIterator  |  Apps Script  |  Google Developers\" target=\"_blank\">FileIterator.next<\/a>\u30e1\u30bd\u30c3\u30c9\u3067File\u53d6\u5f97<br \/>\n\u2193<br \/>\n<a href=\"https:\/\/developers.google.com\/apps-script\/reference\/slides\/slide#insertImage(BlobSource)\" title=\"Class Slide  |  Apps Script  |  Google Developers\" target=\"_blank\">Slide.insertImage<\/a>\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306b<a href=\"https:\/\/developers.google.com\/apps-script\/reference\/drive\/file#getBlob()\" title=\"Class File  |  Apps Script  |  Google Developers\" target=\"_blank\">File.getBlob<\/a>\u30e1\u30bd\u30c3\u30c9\u3067\u53d6\u5f97\u3057\u305f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306eBlob\u3092\u6307\u5b9a\u3057\u3066\u3001\u30b9\u30e9\u30a4\u30c9\u306b\u753b\u50cf\u3092\u633f\u5165<\/p>\n<p>Google\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u30b5\u30fc\u30d3\u30b9\u9593\u306e\u9023\u643a\u304c\u53d6\u308a\u3084\u3059\u3044\u306e\u306fGAS\u306e\u5927\u304d\u306a\u9b45\u529b\u306e\u4e00\u3064\u3067\u3059\u306d\uff01<\/p>\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":"\u6700\u8fd1\u53d6\u308a\u6271\u3063\u3066\u3044\u308bGoogle Apps Script\u306b\u3088\u308bGoogle \u30b9\u30e9\u30a4\u30c9\u64cd\u4f5c\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u3088\u308aGAS\u3089\u3057\u304f\u201cGoogle \u30c9\u30e9\u30a4\u30d6\u306b\u3042\u308b\u753b\u50cf\u3092\u30b9\u30e9\u30a4\u30c9\u306b\u633f\u5165\u3059\u308b\u201d\u51e6\u7406\u3092\u884c\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 \u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b [&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]Google \u30c9\u30e9\u30a4\u30d6\u306b\u3042\u308b\u753b\u50cf\u3092\u30b9\u30e9\u30a4\u30c9\u306b\u633f\u5165\u3059\u308b]","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-10878","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-2Ps","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10878","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=10878"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10878\/revisions"}],"predecessor-version":[{"id":10880,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10878\/revisions\/10880"}],"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=10878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}