{"id":13050,"date":"2020-08-04T16:00:37","date_gmt":"2020-08-04T07:00:37","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=13050"},"modified":"2020-08-04T16:00:37","modified_gmt":"2020-08-04T07:00:37","slug":"google-apps-script%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%82%ab%e3%83%83%e3%83%88%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=13050","title":{"rendered":"[Google Apps Script]\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b"},"content":{"rendered":"<p><a href=\"https:\/\/developers.google.com\/apps-script\/releases\/\" title=\"Release Notes  |  Apps Script  |  Google Developers\" target=\"_blank\" rel=\"noopener noreferrer\">\u30ea\u30ea\u30fc\u30b9\u30ce\u30fc\u30c8<\/a>\u306b\u3088\u308b\u3068\u3001\u5148\u6708\u306eGoogle Apps Script\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3067\u3001\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3084\u30d5\u30a1\u30a4\u30eb\u3092\u79fb\u52d5\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3088\u3046\u306a\u306e\u3067\u3001\u3055\u3063\u305d\u304f\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/drive\/folder#createshortcuttargetid\" title=\"Class Folder  |  Apps Script  |  Google Developers\" target=\"_blank\" rel=\"noopener noreferrer\">createShortcut<\/a>\u30e1\u30bd\u30c3\u30c9\u3067\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001<a href=\"https:\/\/developers.google.com\/apps-script\/reference\/drive\/file#movetodestination\" title=\"Class File  |  Apps Script  |  Google Developers\" target=\"_blank\" rel=\"noopener noreferrer\">moveTo<\/a>\u30e1\u30bd\u30c3\u30c9\u3067\u4f5c\u6210\u3057\u305f\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u79fb\u52d5\u3059\u308b\u3060\u3051\u306e\u7c21\u5358\u306a\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">function myFunction() {\r\n  const fol = DriveApp.getFolderById(&quot;(\u30d5\u30a9\u30eb\u30c0ID)&quot;);\r\n  const shortcutFile = fol.createShortcut(&quot;(\u30d5\u30a1\u30a4\u30ebID)&quot;).setName(&quot;\u30c6\u30b9\u30c8\u7528\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb&quot;); \/\/\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\r\n  console.log(&quot;TargetId:&quot; + shortcutFile.getTargetId() + &quot;, TargetMimeType:&quot; + shortcutFile.getTargetMimeType()); \/\/\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u30ea\u30f3\u30af\u5148\u30d5\u30a1\u30a4\u30eb\u306eID\u3068MimeType\u3092\u53d6\u5f97\r\n  shortcutFile.moveTo(DriveApp.getRootFolder()); \/\/\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u30eb\u30fc\u30c8\u30d5\u30a9\u30eb\u30c0\u306b\u79fb\u52d5\r\n}<\/pre>\n<p><a href=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_01.jpg\" alt=\"\" width=\"591\" height=\"140\" class=\"alignnone size-full wp-image-13051\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_01.jpg 591w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_01-300x71.jpg 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_02.jpg\" alt=\"\" width=\"382\" height=\"111\" class=\"alignnone size-full wp-image-13052\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_02.jpg 382w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_02-300x87.jpg 300w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><\/a><\/p>\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u6a5f\u4f1a\u306f\u3042\u307e\u308a\u7121\u3055\u305d\u3046\u3067\u3059\u304c\u3001\u30d5\u30a1\u30a4\u30eb\u3084\u30d5\u30a9\u30eb\u30c0\u3092\u79fb\u52d5\u3059\u308bmoveTo\u30e1\u30bd\u30c3\u30c9\u306e\u65b9\u306f\u51fa\u756a\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001<a href=\"https:\/\/developers.google.com\/apps-script\/releases\/\" title=\"Release Notes  |  Apps Script  |  Google Developers\" target=\"_blank\" rel=\"noopener noreferrer\">\u30ea\u30ea\u30fc\u30b9\u30ce\u30fc\u30c8<\/a>\u306b\u3088\u308b\u3068\u3001Folder\u30af\u30e9\u30b9\u306e\u4e0b\u8a18\u30e1\u30bd\u30c3\u30c9\u304c\u5ec3\u6b62\u3055\u308c\u305f\u3088\u3046\u306a\u306e\u3067\u3001\u540c\u30e1\u30bd\u30c3\u30c9\u3092\u304a\u4f7f\u3044\u306e\u65b9\u306f\u30b3\u30fc\u30c9\u3092\u4fee\u6b63\u3057\u305f\u65b9\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<ul>\n<li>addFile(File)<\/li>\n<li>addFolder(Folder)<\/li>\n<li>removeFile(File)<\/li>\n<li>removeFolder(Folder)<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_03.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_03.jpg\" alt=\"\" width=\"414\" height=\"148\" class=\"alignnone size-full wp-image-13053\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_03.jpg 414w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GAS_createShortcut_03-300x107.jpg 300w\" sizes=\"auto, (max-width: 414px) 100vw, 414px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\u30ea\u30ea\u30fc\u30b9\u30ce\u30fc\u30c8\u306b\u3088\u308b\u3068\u3001\u5148\u6708\u306eGoogle Apps Script\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3067\u3001\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3084\u30d5\u30a1\u30a4\u30eb\u3092\u79fb\u52d5\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3088\u3046\u306a\u306e\u3067\u3001\u3055\u3063\u305d\u304f\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002 createSho [&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]\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\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-13050","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-3ou","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/13050","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=13050"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/13050\/revisions"}],"predecessor-version":[{"id":13055,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/13050\/revisions\/13055"}],"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=13050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}