{"id":12905,"date":"2020-07-03T12:00:01","date_gmt":"2020-07-03T03:00:01","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=12905"},"modified":"2020-07-03T14:12:09","modified_gmt":"2020-07-03T05:12:09","slug":"google-apps-scriptgoogle%e3%82%b9%e3%83%a9%e3%82%a4%e3%83%89%e3%81%ae%e3%83%97%e3%83%ac%e3%82%bc%e3%83%b3%e3%83%86%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92%e4%bb%96%e5%bd%a2%e5%bc%8f%e3%81%ab","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=12905","title":{"rendered":"[Google Apps Script]Google\u30b9\u30e9\u30a4\u30c9\u306e\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4ed6\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b"},"content":{"rendered":"<p>\u4e45\u3057\u3076\u308a\u306bGAS\u30cd\u30bf\u3067\u3059\u3002<br \/>\n\u30c9\u30e9\u30a4\u30d6\u306b\u3042\u308b\u8907\u6570\u306e\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092PowerPoint\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u624b\u4f5c\u696d\u3067\u884c\u3046\u306e\u306f\u9762\u5012\u304f\u3055\u304b\u3063\u305f\u306e\u3067\u3001\u7c21\u5358\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4ed5\u7d44\u307f\u306f\u4e0b\u8a18\u8a18\u4e8b\u3068\u5927\u4f53\u540c\u3058\u3067\u3059\u3002<br \/>\n\u30d5\u30a1\u30a4\u30eb\u30e1\u30cb\u30e5\u30fc \u2192 \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 \u2192 \u5404\u5f62\u5f0f \u3092\u5b9f\u884c\u3057\u305f\u3068\u304d\u306eURL\u3092\u53e9\u3051\u3070\u826f\u3044\u3060\u3051\u3067\u3059\u306d\u3002<\/p>\n<div class=\"cardlink\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=11966\"><div class=\"cardlink_thumbnail\"><img src='https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Google-120x120.png' alt='[Google Apps Script]\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092Excel\u30d5\u30a1\u30a4\u30eb(xlsx)\u306b\u5909\u63db\u3059\u308b' width=120 height=120 \/><\/a><\/div><div class=\"cardlink_content\"><span class=\"timestamp\">2019.07.26<\/span><div class=\"cardlink_title\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=11966\">[Google Apps Script]\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092Excel\u30d5\u30a1\u30a4\u30eb(xlsx)\u306b\u5909\u63db\u3059\u308b <\/a><\/div><div class=\"cardlink_excerpt\">\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u30e1\u30cb\u30e5\u30fc \u2192 \u5f62\u5f0f\u3092\u6307\u5b9a\u3057\u3066\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 \u2192 Microsoft Excel\uff08.xlsx\uff09 \u304b\u3089\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092Excel\u30d5\u30a1\u30a4\u30eb\u306b\u5909\u63db\u3067\u304d\u307e\u3059\u304c\u3001\u4e0b\u8a18URL\u306bID\u3092\u6e21\u3059\u3053\u3068\u3067\u540c\u3058\u51e6\u7406\u304c\u3067\u304d\u308b\u3053\u3068\u3092\u3001\u4eca\u3055\u3089\u306a\u304c\u3089\u306b\u77e5\u308a\u307e\u3057\u305f\u3002\r\n...<\/div><\/div><div class=\"cardlink_footer\"><\/div><\/div>\n<p>\u6298\u89d2\u306a\u306e\u3067PowerPoint\u4ee5\u5916\u3001PDF\u3084PNG\u3001JPG\u3068\u3044\u3063\u305f\u5f62\u5f0f\u306b\u3082\u5bfe\u5fdc\u3055\u305b\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">function myFunction() {\r\n  const id = &quot;(\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3ID)&quot;;\r\n  const file = convertPresentation(id, &quot;pptx&quot;);\r\n  console.log(file.getName());\r\n}\r\n\r\n\/\/\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4ed6\u5f62\u5f0f\u306b\u5909\u63db\u3057\u3066\u30c9\u30e9\u30a4\u30d6\u306b\u4fdd\u5b58\u3001File\u3092\u8fd4\u3059\r\n\/\/\u203bJPEG, PNG, SVG\u306f\u6700\u521d\u306e\u30b9\u30e9\u30a4\u30c9\u306e\u307f\r\nfunction convertPresentation(presentation_id, format) {\r\n  format = format.toLowerCase();\r\n  let ext = format;\r\n  switch (format) {\r\n    case &quot;pptx&quot;:\r\n    case &quot;odp&quot;:\r\n    case &quot;pdf&quot;:\r\n    case &quot;txt&quot;:\r\n    case &quot;png&quot;:\r\n    case &quot;svg&quot;:\r\n      break;\r\n    case &quot;jpg&quot;:\r\n    case &quot;jpeg&quot;:\r\n      format = &quot;jpeg&quot;;\r\n      ext = &quot;jpg&quot;;\r\n      break;\r\n    default:\r\n      format = &quot;pptx&quot;;\r\n      ext = &quot;pptx&quot;\r\n      break;\r\n  }\r\n  const url = &quot;https:\/\/docs.google.com\/presentation\/d\/&quot; + presentation_id + &quot;\/export\/&quot; + format;\r\n  const options = {\r\n    method: &quot;get&quot;,\r\n    headers: {&quot;Authorization&quot;: &quot;Bearer &quot; + ScriptApp.getOAuthToken()},\r\n    muteHttpExceptions: true\r\n  };\r\n  const res = UrlFetchApp.fetch(url, options);\r\n  if (res.getResponseCode() === 200) {\r\n    const prs = SlidesApp.openById(presentation_id);\r\n    return DriveApp.createFile(res.getBlob()).setName(prs.getName() + &quot;.&quot; + ext);\r\n  }\r\n}<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u6307\u5b9a\u3057\u305f\u5f62\u5f0f\u306e\u540c\u540d\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u30c9\u30e9\u30a4\u30d6\u4e0a\u306b\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<br \/>\n\u5f62\u5f0f\u306e\u5224\u5b9a\u51e6\u7406\u3067\u30b3\u30fc\u30c9\u91cf\u304c\u591a\u3044\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u304c\u3001\u81f3\u3063\u3066\u30b7\u30f3\u30d7\u30eb\u306b\u5b9f\u88c5\u3067\u304d\u307e\u3057\u305f\u3002<\/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":"\u4e45\u3057\u3076\u308a\u306bGAS\u30cd\u30bf\u3067\u3059\u3002 \u30c9\u30e9\u30a4\u30d6\u306b\u3042\u308b\u8907\u6570\u306e\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092PowerPoint\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u624b\u4f5c\u696d\u3067\u884c\u3046\u306e\u306f\u9762\u5012\u304f\u3055\u304b\u3063\u305f\u306e\u3067\u3001\u7c21\u5358\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 \u4ed5\u7d44\u307f\u306f\u4e0b\u8a18\u8a18\u4e8b\u3068\u5927\u4f53\u540c\u3058\u3067\u3059 [&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\u30b9\u30e9\u30a4\u30c9\u306e\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4ed6\u5f62\u5f0f\u306b\u5909\u63db\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-12905","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-3m9","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12905","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=12905"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12905\/revisions"}],"predecessor-version":[{"id":12906,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12905\/revisions\/12906"}],"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=12905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}