{"id":22858,"date":"2025-05-29T16:11:55","date_gmt":"2025-05-29T07:11:55","guid":{"rendered":"https:\/\/cg-method.com\/google\/?p=22858"},"modified":"2026-10-02T23:46:28","modified_gmt":"2026-10-02T14:46:28","slug":"gas-rename-files-in-folder","status":"publish","type":"post","link":"https:\/\/cg-method.com\/google\/gas-rename-files-in-folder\/","title":{"rendered":"Google\u30c9\u30e9\u30a4\u30d6\u2502\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u4e00\u62ec\u30ea\u30cd\u30fc\u30e0\uff01\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3057\u3066\u81ea\u52d5\u5909\u66f4\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u30d5\u30a9\u30eb\u30c0\u30fc\u76f4\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u4e00\u62ec\u3067\u7f6e\u63db\u3059\u308b\u306b\u306f\u3001\u5909\u66f4\u524d\u306e\u540d\u524d\u3068ID\u3092\u4fdd\u5b58\u3057\u3001\u7f6e\u63db\u7d50\u679c\u3092\u5148\u306b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u306eGAS\u306f\u5b50\u30d5\u30a9\u30eb\u30c0\u30fc\u3078\u5165\u3089\u305a\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u3060\u3051\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6587\u3084\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u5148\u306f\u5909\u66f4\u3057\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u969b\u306e\u696d\u52d9\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u4f7f\u3046\u524d\u306b\u3001\u5c02\u7528\u306e\u7df4\u7fd2\u30d5\u30a9\u30eb\u30c0\u30fc\u3067\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5165\u529b\u4f8b\u3068\u7f6e\u63db\u5f8c\u306e\u540d\u524d<\/h2>\n\n\n\n<figure class=\"wp-block-table\" tabindex=\"0\" aria-label=\"\u6a2a\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u308b\u6bd4\u8f03\u8868\"><table class=\"has-fixed-layout\" style=\"min-width:24em\"><thead><tr><th style=\"min-width:8em !important\">\u5909\u66f4\u524d<\/th><th style=\"min-width:8em !important\">\u6700\u521d\u306e1\u7b87\u6240\u3092\u7f6e\u63db<\/th><th style=\"min-width:8em !important\">\u3059\u3079\u3066\u3092\u7f6e\u63db<\/th><\/tr><\/thead><tbody><tr><td>sample_sample.txt<\/td><td>\u30b5\u30f3\u30d7\u30eb_sample.txt<\/td><td>\u30b5\u30f3\u30d7\u30eb_\u30b5\u30f3\u30d7\u30eb.txt<\/td><\/tr><tr><td>sample.txt<\/td><td>\u30b5\u30f3\u30d7\u30eb.txt<\/td><td>\u30b5\u30f3\u30d7\u30eb.txt<\/td><\/tr><tr><td>notes.txt<\/td><td>notes.txt\uff1a\u5909\u66f4\u3057\u306a\u3044<\/td><td>notes.txt\uff1a\u5909\u66f4\u3057\u306a\u3044<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">RENAME_ALL\u304cfalse\u306a\u3089\u6700\u521d\u306e1\u7b87\u6240\u3060\u3051\u3001true\u306a\u3089\u3059\u3079\u3066\u306e\u540c\u3058\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b63\u898f\u8868\u73fe\u3067\u306f\u306a\u304f\u6587\u5b57\u5217\u3092\u4f7f\u3046\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u62e1\u5f35\u5b50\u3082\u540d\u524d\u306e\u4e00\u90e8\u306a\u306e\u3067\u3001\u7f6e\u63db\u524d\u306e\u6587\u5b57\u5217\u304c\u62e1\u5f35\u5b50\u306b\u542b\u307e\u308c\u308b\u5834\u5408\u306f\u7d50\u679c\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cg-method.com\/google\/wp-content\/uploads\/2026\/10\/cgm-google-drive-scope-10-22858-native.jpg\" alt=\"sample_sample.txt\u306e\u6700\u521d\u306esample\u3060\u3051\u304c\u30b5\u30f3\u30d7\u30eb\u3078\u5909\u308f\u308a\u5b50\u30d5\u30a9\u30eb\u30c0\u30fc\u306f\u6b8b\u3063\u3066\u3044\u308b\" width=\"930\" height=\"188\" class=\"wp-image-23588\" srcset=\"https:\/\/cg-method.com\/google\/wp-content\/uploads\/2026\/10\/cgm-google-drive-scope-10-22858-native.jpg 930w, https:\/\/cg-method.com\/google\/wp-content\/uploads\/2026\/10\/cgm-google-drive-scope-10-22858-native-300x61.jpg 300w, https:\/\/cg-method.com\/google\/wp-content\/uploads\/2026\/10\/cgm-google-drive-scope-10-22858-native-768x155.jpg 768w\" sizes=\"auto, (max-width: 930px) 100vw, 930px\" \/><figcaption class=\"wp-element-caption\">\u540d\u524d\u5909\u66f4\u306e\u5b9f\u753b\u9762\u3002\u5c02\u7528\u30d5\u30a1\u30a4\u30eb\u3092Drive API\u3067\u5909\u66f4\u3057\u3001\u540c\u3058ID\u306e\u307e\u307e\u5143\u306e\u540d\u524d\u3078\u623b\u305b\u308b\u3053\u3068\u3082\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002\u63b2\u8f09GAS\u306e\u5b9f\u884c\u753b\u9762\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d7\u30ec\u30d3\u30e5\u30fc\u3068\u5909\u66f4\u3092\u5206\u3051\u305fGAS\u30b3\u30fc\u30c9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u65b0\u898f\u306eApps Script\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u8cbc\u308a\u4ed8\u3051\u3001RENAME_FOLDER_ID\u3092\u7df4\u7fd2\u7528\u30d5\u30a9\u30eb\u30c0\u30fc\u306eURL\u306b\u3042\u308bID\u3078\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">RENAME_FROM\u3068RENAME_TO\u306f\u7f6e\u63db\u524d\u30fb\u7f6e\u63db\u5f8c\u306e\u6587\u5b57\u5217\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u51e6\u7406\u5bfe\u8c61\u306f\u76f4\u4e0b50\u30d5\u30a1\u30a4\u30eb\u4ee5\u5185\u3067\u3001\u7f6e\u63db\u5f8c\u306e\u540c\u540d\u885d\u7a81\u3001\u7a7a\u306e\u691c\u7d22\u6587\u5b57\u5217\u3001\u7a7a\u306e\u7d50\u679c\u540d\u3092\u4e8b\u524d\u306b\u6b62\u3081\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\"><code>const RENAME_FOLDER_ID = &#x27;\u7df4\u7fd2\u7528\u30d5\u30a9\u30eb\u30c0\u30fc\u306eID&#x27;;\nconst RENAME_FROM = &#x27;sample&#x27;;\nconst RENAME_TO = &#x27;\u30b5\u30f3\u30d7\u30eb&#x27;;\nconst RENAME_ALL = false; \/\/ false: \u6700\u521d\u306e1\u7b87\u6240\u3001true: \u3059\u3079\u3066\nconst RENAME_PLAN_KEY = &#x27;cgmRenamePlanV1&#x27;;\n\nfunction collectRenamePlan_() {\n  if (!RENAME_FROM) throw new Error(&#x27;\u7f6e\u63db\u524d\u306e\u6587\u5b57\u5217\u3092\u7a7a\u306b\u3057\u306a\u3044\u3067\u304f\u3060\u3055\u3044&#x27;);\n  const folder = DriveApp.getFolderById(RENAME_FOLDER_ID);\n  const iterator = folder.getFiles(); \/\/ \u76f4\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3060\u3051\n  const files = [];\n  while (iterator.hasNext()) {\n    if (files.length &gt;= 50) throw new Error(&#x27;\u7df4\u7fd2\u5bfe\u8c61\u306f50\u30d5\u30a1\u30a4\u30eb\u4ee5\u5185\u3067\u3059&#x27;);\n    const file = iterator.next();\n    const before = file.getName();\n    const after = RENAME_ALL ? before.split(RENAME_FROM).join(RENAME_TO)\n      : before.replace(RENAME_FROM, () =&gt; RENAME_TO);\n    if (!after.trim()) throw new Error(&#x27;\u7a7a\u306e\u540d\u524d\u306b\u306a\u308b\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308a\u307e\u3059&#x27;);\n    files.push({ id: file.getId(), before, after });\n  }\n  const names = files.map(item =&gt; item.after);\n  if (new Set(names).size !== names.length) {\n    throw new Error(&#x27;\u7f6e\u63db\u5f8c\u306e\u540d\u524d\u304c\u91cd\u8907\u3057\u307e\u3059\u3002\u5909\u66f4\u524d\u306b\u6574\u7406\u3057\u3066\u304f\u3060\u3055\u3044&#x27;);\n  }\n  return { folderId: RENAME_FOLDER_ID, files };\n}\n\nfunction previewRename() {\n  const plan = collectRenamePlan_();\n  const json = JSON.stringify(plan);\n  if (Utilities.newBlob(json).getBytes().length &gt; 8000) {\n    throw new Error(&#x27;\u4fdd\u5b58\u3059\u308b\u8a08\u753b\u304c\u5927\u304d\u3059\u304e\u307e\u3059\u3002\u5bfe\u8c61\u3092\u6e1b\u3089\u3057\u3066\u304f\u3060\u3055\u3044&#x27;);\n  }\n  PropertiesService.getScriptProperties().setProperty(RENAME_PLAN_KEY, json);\n  console.log(JSON.stringify(plan, null, 2)); \/\/ \u5909\u66f4\u524d\u306e\u540d\u524d\u30fbID\u3092\u4fdd\u5b58\u3059\u308b\n  return plan;\n}\n\nfunction applyRename() {\n  const saved = PropertiesService.getScriptProperties().getProperty(RENAME_PLAN_KEY);\n  if (!saved) throw new Error(&#x27;\u5148\u306bpreviewRename\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044&#x27;);\n  const plan = JSON.parse(saved);\n  const fresh = collectRenamePlan_();\n  const ordered = value =&gt; JSON.stringify(value.files.slice().sort((a,b) =&gt; a.id.localeCompare(b.id)));\n  if (plan.folderId !== fresh.folderId || ordered(plan) !== ordered(fresh)) {\n    throw new Error(&#x27;\u30d7\u30ec\u30d3\u30e5\u30fc\u5f8c\u306b\u5bfe\u8c61\u30fb\u540d\u524d\u30fb\u8a2d\u5b9a\u304c\u5909\u308f\u308a\u307e\u3057\u305f\u3002\u5909\u66f4\u306f\u3057\u3066\u3044\u307e\u305b\u3093&#x27;);\n  }\n  const done = [];\n  try {\n    for (const item of plan.files) {\n      if (item.before === item.after) continue;\n      DriveApp.getFileById(item.id).setName(item.after);\n      done.push(item.id);\n    }\n  } catch (error) {\n    console.log(JSON.stringify({ doneIds: done, error: String(error) }));\n    throw error; \/\/ \u81ea\u52d5\u3067\u518d\u5b9f\u884c\u3057\u306a\u3044\u3002\u4fdd\u5b58\u6e08\u307f\u8a08\u753b\u3067\u5909\u66f4\u6e08\u307fID\u3092\u78ba\u8a8d\u3059\u308b\n  }\n  console.log(JSON.stringify({ changed: done.length, doneIds: done }));\n}\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u884c\u3068\u7d50\u679c\u306e\u78ba\u8a8d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305apreviewRename\u3092\u9078\u3093\u3067\u5b9f\u884c\u3057\u3001\u5b9f\u884c\u30ed\u30b0\u306b\u51fa\u308bid\u30fbbefore\u30fbafter\u3092\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u5909\u66f4\u3055\u308c\u307e\u305b\u3093\u304c\u3001\u8a08\u753b\u306f\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306b\u5bfe\u8c61\u4ef6\u6570\u3068\u3059\u3079\u3066\u306e\u540d\u524d\u3092\u78ba\u8a8d\u3057\u3001\u610f\u56f3\u3069\u304a\u308a\u306e\u5834\u5408\u3060\u3051applyRename\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Google\u306e\u6a29\u9650\u78ba\u8a8d\u304c\u51fa\u305f\u5834\u5408\u306f\u3001\u5bfe\u8c61\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068Drive\u306e\u8981\u6c42\u6a29\u9650\u3092\u81ea\u5206\u3067\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d7\u30ec\u30d3\u30e5\u30fc\u5f8c\u306b\u30d5\u30a1\u30a4\u30eb\u306e\u8ffd\u52a0\u30fb\u524a\u9664\u30fb\u540d\u524d\u3084\u7f6e\u63db\u8a2d\u5b9a\u306e\u5909\u66f4\u304c\u3042\u308c\u3070\u3001applyRename\u306f\u4e8b\u524d\u78ba\u8a8d\u3067\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u76f4\u524d\u78ba\u8a8d\u306e\u5f8c\u306b\u5225\u306e\u4eba\u304c\u540d\u524d\u3092\u5909\u3048\u308b\u7af6\u5408\u307e\u3067\u30ed\u30c3\u30af\u3067\u304d\u308b\u51e6\u7406\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5171\u540c\u7de8\u96c6\u3092\u6b62\u3081\u305f\u5c02\u7528\u5bfe\u8c61\u3067\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5909\u66f4\u4e0d\u8981\u306e\u30d5\u30a1\u30a4\u30eb\u306fsetName\u3092\u547c\u3073\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Drive API\u306b\u3088\u308b\u5c02\u7528\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u5909\u66f4\u3067\u306f\u3001sample_sample.txt\u304b\u3089\u30b5\u30f3\u30d7\u30eb_sample.txt\u3078\u5909\u308f\u308a\u3001\u540c\u3058ID\u30fb\u4fdd\u5b58\u5148\u30fb30\u30d0\u30a4\u30c8\u306e\u30b5\u30a4\u30ba\u304c\u7dad\u6301\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8aad\u307f\u53d6\u3063\u305f\u672c\u6587\u3082\u7df4\u7fd2\u30c6\u30ad\u30b9\u30c8\u3068\u4e00\u81f4\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3055\u3089\u306b\u5143\u306e\u540d\u524d\u3078\u623b\u305b\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3001\u63b2\u8f09GAS\u306eDrive\u6a29\u9650\u53d6\u5f97\u3068\u66f8\u304d\u63db\u3048\u306f\u672a\u5b9f\u884c\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b3\u30fc\u30c9\u306f\u69cb\u6587\u78ba\u8a8d\u3068\u660e\u793a\u7684\u306aNode\u6a21\u64ec\u691c\u8a3c\u3092\u884c\u3063\u305f\u3082\u306e\u3067\u3001\u5b9f\u753b\u9762\u3092GAS\u306e\u5b9f\u884c\u8a3c\u62e0\u3068\u3057\u3066\u6271\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u9014\u4e2d\u3067\u6b62\u307e\u3063\u305f\u3068\u304d\u3068\u623b\u3057\u65b9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u9014\u4e2d\u5931\u6557\u306f\u4e00\u62ec\u53d6\u6d88\u306b\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u884c\u30ed\u30b0\u306edoneIds\u3068\u3001previewRename\u3067\u4fdd\u5b58\u3057\u305fID\u30fb\u5909\u66f4\u524d\u306e\u540d\u524d\u3092\u7167\u5408\u3057\u3001\u5909\u66f4\u6e08\u307f\u306e\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u540c\u3058\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u3063\u3066\u3082\u3001\u5143\u306eURL\u306eID\u3067\u5bfe\u8c61\u3092\u958b\u304d\u3001\u540d\u524d\u3092\u5143\u306b\u623b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5225\u306e\u4eba\u304c\u3055\u3089\u306b\u540d\u524d\u3092\u5909\u3048\u3066\u3044\u305f\u5834\u5408\u306f\u4e0a\u66f8\u304d\u305b\u305a\u8abf\u6574\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d7\u30ec\u30d3\u30e5\u30fc\u3092\u3084\u308a\u76f4\u3059\u3068\u4fdd\u5b58\u6e08\u307f\u306e\u8a08\u753b\u3092\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5fa9\u65e7\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001\u5148\u306b\u524d\u306e\u30ed\u30b0\u3068\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5931\u6557\u5f8c\u306b\u540c\u3058\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3055\u305a\u3001\u73fe\u5728\u306e\u540d\u524d\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/cg-method.com\/google\/wp-content\/uploads\/2026\/10\/cgm-drive-library-practice-20261002.zip\">\u7df4\u7fd2\u7528\u30d5\u30a1\u30a4\u30eb\u30fb\u30b3\u30fc\u30c9\u30fb\u30ed\u30fc\u30ab\u30eb\u691c\u8a3c\u3092\u307e\u3068\u3081\u305fZIP<\/a>\u306b\u306f\u540c\u540d\u885d\u7a81\u30fb\u5bfe\u8c61\u5897\u52a0\u30fb\u9014\u4e2d\u5931\u6557\u306a\u3069\u306e\u6a21\u64ec\u691c\u8a3c\u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u516c\u5f0f\u4ed5\u69d8\u3068\u95a2\u9023\u3059\u308b\u64cd\u4f5c<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/drive\/folder\">Folder.getFiles\u306e\u516c\u5f0f\u4ed5\u69d8<\/a>\u3068<a href=\"https:\/\/developers.google.com\/apps-script\/reference\/drive\/file\">File.setName\u306e\u516c\u5f0f\u4ed5\u69d8<\/a>\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b3\u30d4\u30fc\u3092\u5148\u306b\u4f5c\u308b\u5834\u5408\u306f<a href=\"https:\/\/cg-method.com\/google\/gas-copy-files-between-folders\/\">Google\u30c9\u30e9\u30a4\u30d6\u2502\u30d5\u30a9\u30eb\u30c0\u30fc\u76f4\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u307e\u3068\u3081\u3066\u30b3\u30d4\u30fc\u3059\u308b\u65b9\u6cd5<\/a>\u3001\u5171\u540c\u4f5c\u696d\u8005\u306e\u7bc4\u56f2\u306f<a href=\"https:\/\/cg-method.com\/google\/google-drive-sharing-permissions\/\">Google\u30c9\u30e9\u30a4\u30d6\u2502\u5171\u6709\u8a2d\u5b9a\u3068\u6a29\u9650\u306e\u9055\u3044\uff5c\u95b2\u89a7\u8005\u30fb\u30b3\u30e1\u30f3\u30c8\u53ef\u30fb\u7de8\u96c6\u8005\u30fb\u30ea\u30f3\u30af\u5171\u6709<\/a>\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u95a2\u9023\u3059\u308b\u65e2\u5b58\u8a18\u4e8b\u3068\u6848\u5185<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u95a2\u9023\u3059\u308b\u65e2\u5b58\u8a18\u4e8b\u3068\u5546\u54c1\u6848\u5185\u3092\u4ee5\u4e0b\u306b\u63b2\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7df4\u7fd2\u306f\u672c\u6587\u306e\u5bfe\u8c61\u7bc4\u56f2\u3092\u78ba\u8a8d\u3057\u3066\u9032\u3081\u3001\u672a\u691c\u8a3c\u306e\u5b9f\u884c\u3092\u78ba\u8a8d\u6e08\u307f\u3068\u3057\u3066\u6271\u308f\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cg-method.com\/google\/wp-content\/uploads\/2025\/05\/google-drive-folder-file-count-gas-300x169.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/cg-method.com\/google\/google-drive-folder-file-count-gas\/\">Google\u30c9\u30e9\u30a4\u30d6\u2502\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u6570\u3092\u96c6\u8a08\u3059\u308b\u65b9\u6cd5\u2502GAS<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">\u5404\u30d5\u30a9\u30eb\u30c0\u306e\u76f4\u4e0b\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u6570\u3092\u96c6\u8a08\u3057\u307e\u3059\u3002 \u89aa\u306e\u884c\u306f\u5b50\u306e\u4ef6\u6570\u3092\u5408\u7b97\u305b\u305a\u3001\u5168\u8d70\u67fb\u306e\u5408\u8a08\u306f\u5b9f\u884c\u30ed\u30b0\u306b\u5206\u3051\u3066\u8868\u793a\u3057\u307e\u3059\u3002 \u30d5\u30a1\u30a4\u30eb\u4ef6\u6570\u306f\u4f7f\u7528\u5bb9\u91cf\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 &#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cg-method.com\/google\/wp-content\/uploads\/2025\/05\/google-drive-folder-listing-gas-300x169.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/cg-method.com\/google\/google-drive-folder-listing-gas\/\">Google\u30c9\u30e9\u30a4\u30d6\u2502\u30d5\u30a9\u30eb\u30c0\u5185\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u89a7\u53d6\u5f97\u3059\u308b\u30c4\u30fc\u30eb<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">Google\u30c9\u30e9\u30a4\u30d6\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u62ec\u3067\u4e00\u89a7\u5316\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002 \u30ea\u30e2\u30fc\u30c8\u30ef\u30fc\u30af\u3084\u5171\u6709\u30c9\u30e9\u30a4\u30d6\u3067\u306e\u4f5c\u696d\u304c\u5897\u3048\u308b\u3068\u3001\u30d5\u30a9\u30eb\u30c0\u69cb\u6210\u3084\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u3092\u542b\u3080\u5168\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u5ea6\u306b\u628a\u63e1&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cg-method.com\/google\/wp-content\/uploads\/2025\/05\/google-drive-delete-old-version-300x169.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/cg-method.com\/google\/google-drive-delete-old-version\/\">Google\u30c9\u30e9\u30a4\u30d6\u2502\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u7248\u30c7\u30fc\u30bf\u3092\u624b\u52d5\u3067\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">Google\u30c9\u30e9\u30a4\u30d6\u306b\u4fdd\u5b58\u3057\u305fPDF\u3084\u753b\u50cf\u306a\u3069\u306f\u3001\u300c\u7248\u3092\u7ba1\u7406\u300d\u304b\u3089\u65b0\u3057\u3044\u7248\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3001\u540c\u3058\u30d5\u30a1\u30a4\u30eb\u306e\u5c65\u6b74\u3068\u3057\u3066\u7ba1\u7406\u3067\u304d\u307e\u3059\u3002 Google\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30fb\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/cg-method.com\/google\/wp-content\/uploads\/2025\/05\/drive-create-folder-tomorrow-300x169.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/cg-method.com\/google\/drive-create-folder-tomorrow\/\">Google\u30c9\u30e9\u30a4\u30d6\u2502\u660e\u65e5\u306e\u65e5\u4ed8\u30d5\u30a9\u30eb\u30c0\u3092\u81ea\u52d5\u4f5c\u6210\u3059\u308b\u65b9\u6cd5<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">\u306f\u3058\u3081\u306b\u3001\u30b3\u30fc\u30c9\u5185\u306e\u30d5\u30a9\u30eb\u30c0ID\u3068\u540d\u524d\u4e00\u89a7\u3092\u3054\u81ea\u8eab\u306e\u3082\u306e\u306b\u5909\u66f4\u3057\u3001\u4f5c\u6210\u6a29\u9650\u306e\u3042\u308b\u30c6\u30b9\u30c8\u7528\u30d5\u30a9\u30eb\u30c0\u3067\u8a66\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u65e5\u4ed8\u3092\u65e5\u672c\u6642\u9593\u3067\u6271\u3046\u305f\u3081\u3001Apps Script\u306e\u30d7\u30ed&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>\u30d5\u30a9\u30eb\u30c0\u30fc\u76f4\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u4e00\u62ec\u3067\u7f6e\u63db\u3059\u308b\u306b\u306f\u3001\u5909\u66f4\u524d\u306e\u540d\u524d\u3068ID\u3092\u4fdd\u5b58\u3057\u3001\u7f6e\u63db\u7d50\u679c\u3092\u5148\u306b\u78ba\u8a8d\u3057\u307e\u3059\u3002 \u3053\u306e\u8a18\u4e8b\u306eGAS\u306f\u5b50\u30d5\u30a9\u30eb\u30c0\u30fc\u3078\u5165\u3089\u305a\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u3060\u3051\u3092\u5909\u66f4\u3057\u307e\u3059\u3002 \u672c\u6587\u3084\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u5148\u306f\u5909\u66f4\u3057\u307e\u305b\u3093\u3002 \u5b9f\u969b\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":22860,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","book_review_data":"","footnotes":"","ssp_meta_title":"Google\u30c9\u30e9\u30a4\u30d6\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u4e00\u62ec\u5909\u66f4\uff01GAS\u7f6e\u63db\u8853","ssp_meta_description":"Google Apps Script\uff08GAS\uff09\u3092\u4f7f\u3063\u3066Google\u30c9\u30e9\u30a4\u30d6\u5185\u306b\u3042\u308b\u6307\u5b9a\u30d5\u30a9\u30eb\u30c0\u76f4\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6587\u5b57\u5217\u7f6e\u63db\u3067\u4e00\u62ec\u5909\u66f4\u3059\u308b\u624b\u9806\u3092\u89e3\u8aac\u3002V8\u30e9\u30f3\u30bf\u30a4\u30e0\u6709\u52b9\u6642\u306ereplaceAll\u6d3b\u7528\u3084\u6ce8\u610f\u70b9\u3082\u63b2\u8f09\u3057\u3066\u3044\u307e\u3059\u3002"},"categories":[19],"tags":[18,9],"class_list":["post-22858","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-drive","tag-gas","tag-free"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/posts\/22858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/comments?post=22858"}],"version-history":[{"count":9,"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/posts\/22858\/revisions"}],"predecessor-version":[{"id":23601,"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/posts\/22858\/revisions\/23601"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/media\/22860"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/media?parent=22858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/categories?post=22858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/google\/wp-json\/wp\/v2\/tags?post=22858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}