{"id":89,"date":"2025-03-20T19:17:17","date_gmt":"2025-03-20T10:17:17","guid":{"rendered":"https:\/\/cg-method.com\/illustrator\/?p=89"},"modified":"2026-10-03T13:52:32","modified_gmt":"2026-10-03T04:52:32","slug":"delete-only-parent-layer","status":"publish","type":"post","link":"https:\/\/cg-method.com\/illustrator\/delete-only-parent-layer\/","title":{"rendered":"Illustrator\u30b9\u30af\u30ea\u30d7\u30c8\uff08jsx\uff09\u2502\u5b50\u30ec\u30a4\u30e4\u30fc\u306f\u305d\u306e\u307e\u307e\u3067\u89aa\u30ec\u30a4\u30e4\u30fc\u3060\u3051\u524a\u9664\u3059\u308b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6700\u4e0a\u4f4d\u306e\u89aa\u30ec\u30a4\u30e4\u30fc\u30921\u3064\u3060\u3051\u5bfe\u8c61\u306b\u3057\u3001\u76f4\u4e0b\u306e\u5b50\u30ec\u30a4\u30e4\u30fc\u3092\u540c\u3058\u4f4d\u7f6e\u306e\u6700\u4e0a\u4f4d\u3078\u79fb\u3057\u3066\u304b\u3089\u3001\u7a7a\u306b\u306a\u3063\u305f\u89aa\u3092\u524a\u9664\u3059\u308bJSX\u3067\u3059\u3002\u5b6b\u4ee5\u4e0b\u306e\u968e\u5c64\u306f\u5b50\u3068\u4e00\u7dd2\u306b\u6b8b\u3057\u307e\u3059\u3002<\/p>\n\n\n<p class=\"wp-block-paragraph\">2026\u5e7410\u67083\u65e5\u306b\u30b3\u30fc\u30c9\u3068\u8aac\u660e\u3092\u6539\u4fee\u3057\u307e\u3057\u305f\u3002\u63b2\u8f09\u4f8b\u306f\u30b3\u30d4\u30fc\u3057\u305f\u30c7\u30fc\u30bf\u3067\u8a66\u3057\u3001\u30ec\u30a4\u30e4\u30fc\u69cb\u9020\u3001\u91cd\u306a\u308a\u9806\u3001\u5916\u89b3\u3001\u66f8\u304d\u51fa\u3057\u7d50\u679c\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u73fe\u5728\u306e\u6539\u4fee\u7248\u306b\u3064\u3044\u3066\u3001Illustrator\u3067\u306e\u52d5\u4f5c\u78ba\u8a8d\u306f\u307e\u3060\u5b8c\u4e86\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n<h2 class=\"wp-block-heading\">\u3053\u306e\u51e6\u7406\u304c\u5bfe\u8c61\u306b\u3059\u308b\u69cb\u9020<\/h2>\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u5b9f\u884c\u524d<\/th><th>\u5b9f\u884c\u5f8c<\/th><\/tr><\/thead><tbody><tr><td>\u89aa \u2192 \u5b50A \u2192 \u5b6bA\u3001\u89aa \u2192 \u5b50B<\/td><td>\u5b50A \u2192 \u5b6bA\u3001\u5b50B\u3002\u89aa\u3060\u3051\u524a\u9664\u3002<\/td><\/tr><tr><td>\u89aa\u306e\u76f4\u4e0b\u306b\u56f3\u5f62\u30fb\u6587\u5b57\u306a\u3069\u304c\u3042\u308b<\/td><td>\u524a\u9664\u305b\u305a\u3001\u79fb\u52d5\u524d\u306b\u505c\u6b62\u3002<\/td><\/tr><tr><td>\u4ed6\u306e\u89aa\u30ec\u30a4\u30e4\u30fc<\/td><td>\u51e6\u7406\u5bfe\u8c61\u5916\u3002<\/td><\/tr><tr><td>\u30ed\u30c3\u30af\u30fb\u975e\u8868\u793a\u306e\u89aa\u307e\u305f\u306f\u5b50\u5b6b<\/td><td>\u72b6\u614b\u3092\u5909\u66f4\u305b\u305a\u505c\u6b62\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<p class=\"wp-block-paragraph\">\u89aa\u30ec\u30a4\u30e4\u30fc\u306b\u8a2d\u5b9a\u3057\u305f\u900f\u660e\u5ea6\u3001\u63cf\u753b\u30e2\u30fc\u30c9\u3001\u30de\u30b9\u30af\u3001\u52b9\u679c\u306f\u3001\u5b50\u3092\u5916\u3059\u3068\u898b\u305f\u76ee\u304c\u5909\u308f\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30b3\u30fc\u30c9\u306f\u3001\u305d\u308c\u3089\u3092\u5b50\u306b\u8907\u88fd\u3057\u305f\u308a\u5b8c\u5168\u306b\u691c\u51fa\u3057\u305f\u308a\u3059\u308b\u51e6\u7406\u3092\u6301\u3061\u307e\u305b\u3093\u3002\u89aa\u306e\u5916\u89b3\u304c\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3067\u306f\u4f7f\u308f\u305a\u3001\u624b\u52d5\u3067\u69cb\u9020\u3092\u6574\u7406\u3057\u307e\u3059\u3002<\/p>\n\n\n<h2 class=\"wp-block-heading\">\u65e7\u30b3\u30fc\u30c9\u3067\u524a\u9664\u3055\u308c\u5f97\u305f\u5185\u5bb9<\/h2>\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u524d\u306e\u30b3\u30fc\u30c9\u306f\u5168\u30ec\u30a4\u30e4\u30fc\u3092\u5de1\u56de\u3057\u3066\u30ed\u30c3\u30af\u3068\u8868\u793a\u72b6\u614b\u3092\u5909\u66f4\u3057\u3001\u6700\u521d\u306e\u30ec\u30a4\u30e4\u30fc\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u5b50\u3092\u79fb\u3057\u3066\u3082\u89aa\u306e\u76f4\u4e0b\u306e\u56f3\u5f62\u30fb\u6587\u5b57\u306f\u6b8b\u308b\u305f\u3081\u3001\u89aa\u3068\u4e00\u7dd2\u306b\u524a\u9664\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3057\u305f\u30022026\u5e7410\u67083\u65e5\u306e\u6539\u4fee\u3067\u306f\u3001\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u6700\u4e0a\u4f4d1\u4ef6\u3060\u3051\u3092\u5bfe\u8c61\u306b\u3057\u3001\u76f4\u4e0b\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u3042\u308c\u3070\u64cd\u4f5c\u524d\u306b\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u884c\u624b\u9806<\/h2>\n\n\n<ol class=\"wp-block-list\">\n\n<li>AI\u3092\u5225\u540d\u306e\u30b3\u30d4\u30fc\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3002<\/li>\n\n\n<li>\u30ec\u30a4\u30e4\u30fc\u30d1\u30cd\u30eb\u3067\u5bfe\u8c61\u306e\u6700\u4e0a\u4f4d\u89aa\u3092\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u3057\u3001\u65b0\u3057\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u914d\u7f6e\u5148\u304c\u305d\u306e\u89aa\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3002\u5b50\u5b6b\u3084\u8907\u6570\u30ec\u30a4\u30e4\u30fc\u306e\u9078\u629e\u3068\u306f\u533a\u5225\u3057\u307e\u3059\u3002<\/li>\n\n\n<li>\u89aa\u306e\u76f4\u4e0b\u306b\u56f3\u5f62\u3084\u6587\u5b57\u304c\u306a\u3044\u3053\u3068\u3001\u89aa\u306e\u5916\u89b3\u306b\u4f9d\u5b58\u3057\u3066\u3044\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n\n\n<li>\u4e0b\u306eJSX\u3092\u5b9f\u884c\u3057\u3001\u78ba\u8a8d\u753b\u9762\u306e\u89aa\u540d\u3068\u5b50\u306e\u4ef6\u6570\u3092\u7167\u5408\u3059\u308b\u3002<\/li>\n\n\n<li>\u5b50\u30fb\u5b6b\u306e\u968e\u5c64\u3001\u30ec\u30a4\u30e4\u30fc\u306e\u524d\u5f8c\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4ef6\u6570\u30fb\u5916\u89b3\u3092\u6bd4\u8f03\u3057\u3066\u304b\u3089\u4fdd\u5b58\u3059\u308b\u3002<\/li>\n\n<\/ol>\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\"><code>(function () {\n  try {\n    if (app.documents.length === 0) throw new Error(\"\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002\");\n    var doc = app.activeDocument;\n    var parent = doc.activeLayer;\n    if (parent.parent !== doc) throw new Error(\"\u6700\u4e0a\u4f4d\u306e\u89aa\u30ec\u30a4\u30e4\u30fc\u3092\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\");\n    checkTree(parent);\n    if (parent.layers.length === 0) throw new Error(\"\u5b50\u30ec\u30a4\u30e4\u30fc\u304c\u3042\u308a\u307e\u305b\u3093\u3002\");\n    for (var i = 0; i &lt; parent.pageItems.length; i++) {\n      if (parent.pageItems[i].parent === parent)\n        throw new Error(\"\u89aa\u306e\u76f4\u4e0b\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u3042\u308a\u307e\u3059\u3002\u524a\u9664\u305b\u305a\u7d42\u4e86\u3057\u307e\u3059\u3002\");\n    }\n    var children = [];\n    for (var j = 0; j &lt; parent.layers.length; j++) children.push(parent.layers[j]);\n    if (!confirm(\"\u30b3\u30d4\u30fc\u3057\u305f\u30c7\u30fc\u30bf\u3067\u3059\u304b\uff1f\\n\u89aa\u300c\" + parent.name + \"\u300d\u306e\u5b50 \" + children.length +\n      \" \u4ef6\u3092\u6700\u4e0a\u4f4d\u3078\u79fb\u3057\u3001\u89aa\u3060\u3051\u3092\u524a\u9664\u3057\u307e\u3059\u3002\\n\u89aa\u306e\u5916\u89b3\u30fb\u900f\u660e\u5ea6\u304c\u4e0d\u8981\u306a\u3053\u3068\u3082\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\")) return;\n    for (var k = 0; k &lt; children.length; k++)\n      children[k].move(parent, ElementPlacement.PLACEBEFORE);\n    if (parent.layers.length !== 0 || parent.pageItems.length !== 0)\n      throw new Error(\"\u89aa\u306e\u4e2d\u306b\u9805\u76ee\u304c\u6b8b\u3063\u3066\u3044\u307e\u3059\u3002\u89aa\u306f\u524a\u9664\u3057\u307e\u305b\u3093\u3002\");\n    parent.remove();\n    alert(\"\u89aa\u3092\u524a\u9664\u3057\u307e\u3057\u305f\u3002\u5b50\u306e\u968e\u5c64\u30fb\u91cd\u306a\u308a\u30fb\u5916\u89b3\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002\");\n  } catch (e) {\n    alert(String(e) + \"\\n\u9014\u4e2d\u3067\u5931\u6557\u3057\u305f\u5834\u5408\u3001\u4e00\u90e8\u306e\u79fb\u52d5\u304c\u6b8b\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u4fdd\u5b58\u305b\u305a\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\");\n  }\n  function checkTree(layer) {\n    if (layer.locked || !layer.visible || !layer.editable)\n      throw new Error(\"\u30ed\u30c3\u30af\u30fb\u975e\u8868\u793a\u30fb\u7de8\u96c6\u4e0d\u53ef\u306e\u30ec\u30a4\u30e4\u30fc\u304c\u3042\u308a\u307e\u3059\u3002\");\n    for (var i = 0; i &lt; layer.layers.length; i++) checkTree(layer.layers[i]);\n  }\n}());<\/code><\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">JSX\u306e\u4fdd\u5b58\u3068\u5b9f\u884c<\/h2>\n\n\n<p class=\"wp-block-paragraph\">\u30b3\u30fc\u30c9\u3092UTF-8\u306e\u30c6\u30ad\u30b9\u30c8\u3067\u4fdd\u5b58\u3057\u3001\u62e1\u5f35\u5b50\u3092.jsx\u306b\u3057\u307e\u3059\u3002\u300c\u30d5\u30a1\u30a4\u30eb\u300d\u2192\u300c\u30b9\u30af\u30ea\u30d7\u30c8\u300d\u2192\u300c\u305d\u306e\u4ed6\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u300d\u304b\u3089\u9078\u3073\u307e\u3059\u3002\u4fdd\u5b58\u30fb\u5b9f\u884c\u306e\u8a73\u3057\u3044\u624b\u9806\u306f<a href=\"https:\/\/cg-method.com\/illustrator\/illustrator-script-getting-started\/\">JSX\u5165\u9580<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5404\u30b3\u30fc\u30c9\u306f\u5225\u3005\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n<h2 class=\"wp-block-heading\">\u9014\u4e2d\u3067\u5931\u6557\u3057\u305f\u5834\u5408<\/h2>\n\n\n<p class=\"wp-block-paragraph\">move\u304c\u9014\u4e2d\u3067\u5931\u6557\u3059\u308b\u3068\u3001\u3059\u3067\u306b\u79fb\u52d5\u3057\u305f\u5b50\u3060\u3051\u304c\u6700\u4e0a\u4f4d\u306b\u51fa\u305f\u72b6\u614b\u304c\u6b8b\u308a\u307e\u3059\u3002\u81ea\u52d5\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3084\u81ea\u52d5\u4fdd\u5b58\u306f\u3057\u307e\u305b\u3093\u3002\u89aa\u306e\u524a\u9664\u306b\u306f\u6700\u5f8c\u307e\u3067\u9032\u307e\u305a\u3001\u6b8b\u3063\u305f\u89aa\u3068\u79fb\u52d5\u6e08\u307f\u306e\u5b50\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u78ba\u5b9f\u306b\u5143\u306e\u69cb\u9020\u3078\u623b\u3059\u306b\u306f\u3001\u8a66\u9a13\u7528\u30b3\u30d4\u30fc\u3092\u4fdd\u5b58\u305b\u305a\u9589\u3058\u3066\u958b\u304d\u76f4\u3057\u307e\u3059\u3002<\/p>\n\n\n<p class=\"wp-block-paragraph\">\u79fb\u52d5\u524d\u306e\u5b50\u3092\u914d\u5217\u3078\u63a7\u3048\u3001\u524d\u304b\u3089\u9806\u306b\u89aa\u306e\u76f4\u524d\u3078\u5165\u308c\u307e\u3059\u3002\u5b50\u306e\u76f8\u5bfe\u9806\u5e8f\u3068\u5b6b\u306e\u968e\u5c64\u3092\u4fdd\u3064\u3053\u3068\u3092\u610f\u56f3\u3057\u305f\u51e6\u7406\u3067\u3059\u3002\u5b9f\u6a5f\u3067\u306e\u9806\u5e8f\u30fb\u5916\u89b3\u306e\u6bd4\u8f03\u306f\u5fc5\u8981\u3067\u3059\u3002\u30ec\u30a4\u30e4\u30fc\u53d6\u5f97\u30fb\u79fb\u52d5\u306e\u57fa\u790e\u306f<a href=\"https:\/\/cg-method.com\/illustrator\/layer-operations\/\">\u30ec\u30a4\u30e4\u30fc\u64cd\u4f5c\u306eJSX<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u7167\u8cc7\u6599<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Adobe\u306e<a href=\"https:\/\/helpx.adobe.com\/jp\/illustrator\/desktop\/manage-layers\/lock-and-hide-layers\/delete-layers.html\">\u30ec\u30a4\u30e4\u30fc\u524a\u9664<\/a>\u3001Adobe\u8cc7\u6599\u3092\u3082\u3068\u306b\u7dad\u6301\u3055\u308c\u3066\u3044\u308b<a href=\"https:\/\/ai-scripting.docsforadobe.dev\/jsobjref\/Layer\/\">Layer\u306eAPI\u53c2\u7167<\/a>\u3092\u53c2\u7167\u3057\u307e\u3057\u305f\u3002\u65e7GitHub\u7248\u306f\u4eca\u56de\u306e\u30b3\u30fc\u30c9\u3068\u4e00\u81f4\u3059\u308b\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u4e0a\u4f4d\u306e\u89aa\u30ec\u30a4\u30e4\u30fc\u30921\u3064\u3060\u3051\u5bfe\u8c61\u306b\u3057\u3001\u76f4\u4e0b\u306e\u5b50\u30ec\u30a4\u30e4\u30fc\u3092\u540c\u3058\u4f4d\u7f6e\u306e\u6700\u4e0a\u4f4d\u3078\u79fb\u3057\u3066\u304b\u3089\u3001\u7a7a\u306b\u306a\u3063\u305f\u89aa\u3092\u524a\u9664\u3059\u308bJSX\u3067\u3059\u3002\u5b6b\u4ee5\u4e0b\u306e\u968e\u5c64\u306f\u5b50\u3068\u4e00\u7dd2\u306b\u6b8b\u3057\u307e\u3059\u3002 2026\u5e7410\u67083\u65e5\u306b\u30b3\u30fc\u30c9\u3068\u8aac\u660e\u3092\u6539\u4fee\u3057\u307e\u3057\u305f\u3002\u63b2\u8f09\u4f8b\u306f\u30b3\u30d4\u30fc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":91,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","book_review_data":"","footnotes":"","ssp_meta_title":"\u89aa\u30ec\u30a4\u30e4\u30fc\u3060\u3051\u3092\u524a\u9664\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8","ssp_meta_description":"Illustrator\u306e\u6700\u4e0a\u4f4d\u306e\u89aa1\u4ef6\u3060\u3051\u3092\u5bfe\u8c61\u306b\u3001\u5b50\u30ec\u30a4\u30e4\u30fc\u3092\u6b8b\u3057\u3066\u89aa\u3092\u524a\u9664\u3059\u308bJSX\u3002\u89aa\u306e\u76f4\u4e0b\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u78ba\u8a8d\u3057\u3001\u30ed\u30c3\u30af\u30fb\u975e\u8868\u793a\u3092\u5909\u66f4\u305b\u305a\u51e6\u7406\u3059\u308b\u6539\u4fee\u4f8b\u3067\u3059\u3002"},"categories":[10],"tags":[],"class_list":["post-89","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-script"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/posts\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":9,"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":421,"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/posts\/89\/revisions\/421"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/media\/91"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/illustrator\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}