{"id":294,"date":"2025-03-19T15:06:39","date_gmt":"2025-03-19T06:06:39","guid":{"rendered":"https:\/\/cg-method.com\/photoshop\/?p=294"},"modified":"2026-10-03T20:58:03","modified_gmt":"2026-10-03T11:58:03","slug":"iimport-and-run-action","status":"publish","type":"post","link":"https:\/\/cg-method.com\/photoshop\/iimport-and-run-action\/","title":{"rendered":"Photoshop\u306eJSX\u3067ATN\u3092\u8aad\u307f\u8fbc\u307f\u30fb\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\uff5c\u30bb\u30c3\u30c8\u540d\u3068\u5931\u6557\u6642\u306e\u505c\u6b62"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Photoshop\u306eJSX\u3067\u306f\u3001<code>app.load(File)<\/code>\u3067ATN\u3092\u8aad\u307f\u8fbc\u307f\u3001<code>app.doAction(\u30a2\u30af\u30b7\u30e7\u30f3\u540d, \u30bb\u30c3\u30c8\u540d)<\/code>\u3067\u8aad\u307f\u8fbc\u3093\u3060\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u518d\u751f\u3057\u307e\u3059\u3002ATN\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u3001\u5185\u90e8\u306b\u4fdd\u5b58\u3055\u308c\u305f\u30bb\u30c3\u30c8\u540d\u30fb\u30a2\u30af\u30b7\u30e7\u30f3\u540d\u3092\u305d\u308c\u305e\u308c\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0b\u306f\u81ea\u4f5c\u306e\u7df4\u7fd2ATN\u3068\u753b\u50cf\u30b3\u30d4\u30fc1\u679a\u3092\u4f7f\u3046\u4f8b\u3067\u3059\u3002\u540c\u540d\u30bb\u30c3\u30c8\u304c\u65e2\u306b\u3042\u308b\u5834\u5408\u306f\u505c\u6b62\u3057\u3001\u65e2\u5b58\u30bb\u30c3\u30c8\u306e\u524a\u9664\u3084\u7f6e\u304d\u63db\u3048\u306f\u884c\u3044\u307e\u305b\u3093\u3002Photoshop\u672c\u4f53\u3067\u306e\u8aad\u307f\u8fbc\u307f\u30fb\u518d\u751f\u306f\u672a\u691c\u8a3c\u306e\u305f\u3081\u3001\u4ed5\u4e8b\u7528\u306e\u753b\u50cf\u3092\u4f7f\u3046\u524d\u306b\u7df4\u7fd2\u7528\u306e\u5165\u529b\u3068\u7d50\u679c\u3092\u7167\u5408\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7df4\u7fd2ATN\u3068\u5143\u30b5\u30a4\u30ba\u306e\u753b\u50cf\u30b3\u30d4\u30fc\u3092\u7528\u610f\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/cg-method.com\/photoshop\/photoshop-actions-atn-manage\/\">ATN\u306e\u4fdd\u5b58\u30fb\u8aad\u307f\u8fbc\u307f\u624b\u9806<\/a>\u3067\u3001<code>CGM-ATN-Practice<\/code>\u30bb\u30c3\u30c8\u306e<code>Resize-Width200<\/code>\u3092\u4fdd\u5b58\u3057\u307e\u3059\u3002\u7df4\u7fd2\u30a2\u30af\u30b7\u30e7\u30f3\u306f\u5e45200px\u3078\u5909\u66f4\u3059\u308b\u624b\u9806\u3060\u3051\u306b\u3057\u3001\u958b\u304f\u30fb\u4fdd\u5b58\u30fb\u9589\u3058\u308b\u64cd\u4f5c\u3092\u8a18\u9332\u3057\u307e\u305b\u3093\u3002\u67b6\u7a7a\u306e400\u00d7200px\u753b\u50cf\u306f\u3001\u518d\u751f\u5f8c\u306b200\u00d7100px\u3068\u306a\u308b\u60f3\u5b9a\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ATN\u3092\u4fdd\u5b58\u3057\u305f\u74b0\u5883\u3067\u306f\u5143\u306e\u30bb\u30c3\u30c8\u304c\u30d1\u30cd\u30eb\u306b\u6b8b\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u4f8b\u306f\u540c\u540d\u30bb\u30c3\u30c8\u304c\u3042\u308b\u3068\u8aad\u307f\u8fbc\u307f\u524d\u306b\u505c\u6b62\u3057\u307e\u3059\u3002\u81ea\u4f5c\u306e\u7df4\u7fd2\u30bb\u30c3\u30c8\u3060\u3051\u3092\u5225\u540d\u3078\u5909\u66f4\u3059\u308b\u304b\u3001\u307e\u3060\u305d\u306eATN\u3092\u8ffd\u52a0\u3057\u3066\u3044\u306a\u3044\u74b0\u5883\u3067\u8a66\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ed5\u4e8b\u7528\u306e\u30bb\u30c3\u30c8\u3092\u524a\u9664\u3057\u3066\u7a7a\u304d\u3092\u4f5c\u308b\u624b\u9806\u306f\u4f7f\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5143\u30b5\u30a4\u30ba\u306e\u753b\u50cf\u3092\u958b\u3044\u3066\uff3b\u30a4\u30e1\u30fc\u30b8\uff3d\u2192\uff3b\u8907\u88fd\uff3d\u3067\u7df4\u7fd2\u30b3\u30d4\u30fc\u3092\u4f5c\u308a\u3001\u5143\u753b\u50cf\u3092\u9589\u3058\u307e\u3059\u3002\u30b9\u30af\u30ea\u30d7\u30c8\u5b9f\u884c\u6642\u306f\u672a\u4fdd\u5b58\u306e\u7df4\u7fd2\u30b3\u30d4\u30fc1\u679a\u3060\u3051\u3092\u958b\u304d\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306f\u958b\u3044\u3066\u3044\u308b\u6587\u66f8\u6570\u3092\u78ba\u8a8d\u3057\u307e\u3059\u304c\u3001\u6587\u66f8\u304c\u7df4\u7fd2\u7528\u304b\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u4fdd\u5b58\u64cd\u4f5c\u304c\u542b\u307e\u308c\u308b\u304b\u307e\u3067\u306f\u5224\u5b9a\u3057\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ATN\u3092\u9078\u3073\u3001\u540d\u524d\u3092\u7167\u5408\u3057\u3066\u518d\u751f\u3059\u308b\u30b3\u30fc\u30c9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306e\u30b3\u30fc\u30c9\u3092UTF-8\u306e<code>ImportAndRunAction.jsx<\/code>\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001<a href=\"https:\/\/cg-method.com\/photoshop\/external-jsx\/\">\uff3b\u30d5\u30a1\u30a4\u30eb\uff3d\u2192\uff3b\u30b9\u30af\u30ea\u30d7\u30c8\uff3d\u2192\uff3b\u53c2\u7167\uff3d\u304b\u3089\u5b9f\u884c<\/a>\u3057\u307e\u3059\u3002\u521d\u56de\u306e\u53c2\u7167\u5b9f\u884c\u3067\u306f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u3078\u306e\u914d\u7f6e\u3084Photoshop\u306e\u518d\u8d77\u52d5\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d5\u30a1\u30a4\u30eb\u9078\u629e\u306e\u5f8c\u306b\u3001ATN\u5185\u306e\u30bb\u30c3\u30c8\u540d\u3068\u30a2\u30af\u30b7\u30e7\u30f3\u540d\u3092\u5165\u529b\u3057\u307e\u3059\u3002\u540d\u524d\u306f\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u542b\u3081\u3066\u4e00\u81f4\u3055\u305b\u307e\u3059\u3002\u4f8b\u3048\u3070\u30d5\u30a1\u30a4\u30eb\u540d\u304c<code>cgm-atn-practice.atn<\/code>\u3067\u3082\u3001\u30bb\u30c3\u30c8\u540d\u306f<code>CGM-ATN-Practice<\/code>\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u540d\u306f<code>Resize-Width200<\/code>\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>#target photoshop\n(function () {\n    function trimmed(value) { return String(value).replace(\/^\\s+|\\s+$\/g, &quot;&quot;); }\n    function readSets() {\n        var result = [];\n        for (var i = 1; i &lt;= 500; i++) {\n            var ref = new ActionReference();\n            ref.putIndex(charIDToTypeID(&quot;ASet&quot;), i);\n            var desc;\n            try { desc = executeActionGet(ref); }\n            catch (endOfList) { return result; }\n            var name = desc.getString(charIDToTypeID(&quot;Nm  &quot;));\n            var count = desc.getInteger(charIDToTypeID(&quot;NmbC&quot;));\n            var actions = [];\n            for (var j = 1; j &lt;= count; j++) {\n                var actionRef = new ActionReference();\n                actionRef.putIndex(charIDToTypeID(&quot;Actn&quot;), j);\n                actionRef.putIndex(charIDToTypeID(&quot;ASet&quot;), i);\n                actions.push(executeActionGet(actionRef).getString(charIDToTypeID(&quot;Nm  &quot;)));\n            }\n            result.push({name: name, actions: actions});\n        }\n        throw new Error(&quot;More than 500 sets or unable to determine the end of the list.&quot;);\n    }\n    function matchingSets(sets, name) {\n        var result = [];\n        for (var i = 0; i &lt; sets.length; i++) {\n            if (sets[i].name === name) result.push(sets[i]);\n        }\n        return result;\n    }\n    try {\n        if (app.documents.length !== 1) {\n            alert(&quot;Open just one unsaved practice copy before running this script.&quot;);\n            return;\n        }\n        var file = File.openDialog(&quot;Choose your own practice ATN file&quot;);\n        if (!file) return;\n        if (!file.exists || !\/\\.atn$\/i.test(file.name)) {\n            alert(&quot;Choose an existing .atn file.&quot;);\n            return;\n        }\n        var setName = prompt(&quot;Exact set name stored inside the ATN (not the filename):&quot;, &quot;CGM-ATN-Practice&quot;);\n        if (setName === null) return;\n        var actionName = prompt(&quot;Exact action name inside that set:&quot;, &quot;Resize-Width200&quot;);\n        if (actionName === null) return;\n        setName = trimmed(setName); actionName = trimmed(actionName);\n        if (!setName || !actionName) { alert(&quot;Both names are required.&quot;); return; }\n        if (matchingSets(readSets(), setName).length !== 0) {\n            alert(&quot;This set name is already loaded. Nothing was loaded or played. Inspect your practice sets first.&quot;);\n            return;\n        }\n        app.load(file);\n        var matches = matchingSets(readSets(), setName);\n        if (matches.length !== 1) {\n            alert(&quot;Expected one matching set after loading. No action was played. The loaded set may remain in the panel.&quot;);\n            return;\n        }\n        var actionMatches = 0;\n        for (var k = 0; k &lt; matches[0].actions.length; k++) {\n            if (matches[0].actions[k] === actionName) actionMatches++;\n        }\n        if (actionMatches !== 1) {\n            alert(&quot;Expected one exact matching action. No action was played. The loaded set remains in the panel.&quot;);\n            return;\n        }\n        app.doAction(actionName, setName);\n        alert(&quot;Playback returned without an exception. Inspect the document and output before counting it as successful.&quot;);\n    } catch (e) {\n        alert(&quot;Stopped: &quot; + e.message + &quot;\\nThe loaded set or a partially changed practice document may remain. Inspect before saving.&quot;);\n    }\n}());\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u8aad\u307f\u8fbc\u307f\u5f8c\u306e\u72b6\u614b\u3068\u7d50\u679c\u3092\u78ba\u8a8d\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u751f\u304b\u3089\u4f8b\u5916\u306a\u3057\u3067\u623b\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u3001\u753b\u50cf\u306e\u7d50\u679c\u3092\u4fdd\u8a3c\u3059\u308b\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u30d1\u30cd\u30eb\u306b\u6307\u5b9a\u306e\u30bb\u30c3\u30c8\u3068\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3055\u308c\u3001\u7df4\u7fd2\u30b3\u30d4\u30fc\u304c200\u00d7100px\u306b\u306a\u3063\u305f\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u539f\u672c\u30d5\u30a1\u30a4\u30eb\u306e\u5bf8\u6cd5\u30fb\u66f4\u65b0\u65e5\u6642\u3068\u5185\u5bb9\u3082\u7167\u5408\u3057\u3001\u3053\u306e\u7df4\u7fd2\u3067\u306f\u30b3\u30d4\u30fc\u3092\u4fdd\u5b58\u305b\u305a\u9589\u3058\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8aad\u307f\u8fbc\u307f\u5f8c\u306e\u540d\u524d\u7167\u5408\u3067\u505c\u6b62\u3057\u3066\u3082\u3001\u8ffd\u52a0\u3055\u308c\u305f\u30bb\u30c3\u30c8\u306f\u30d1\u30cd\u30eb\u306b\u6b8b\u308a\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306f\u305d\u308c\u3092\u81ea\u52d5\u3067\u524a\u9664\u3057\u307e\u305b\u3093\u3002\u30d1\u30cd\u30eb\u3067\u5b9f\u969b\u306e\u540d\u524d\u3092\u78ba\u8a8d\u3057\u3001\u5fc5\u8981\u306a\u30a2\u30af\u30b7\u30e7\u30f3\u306f\u5143\u30b5\u30a4\u30ba\u306e\u65b0\u3057\u3044\u7df4\u7fd2\u30b3\u30d4\u30fc\u3067\u624b\u52d5\u518d\u751f\u3057\u3066\u5207\u308a\u5206\u3051\u3066\u304f\u3060\u3055\u3044\u3002\u518d\u5b9f\u884c\u3059\u308b\u3068\u3001\u65e2\u306b\u8aad\u307f\u8fbc\u3093\u3060\u540c\u540d\u30bb\u30c3\u30c8\u306e\u78ba\u8a8d\u3067\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u75c7\u72b6<\/th><th>\u78ba\u8a8d\u3059\u308b\u70b9<\/th><\/tr><\/thead><tbody><tr><td>\u753b\u50cf\u304c\u306a\u3044\u3001\u307e\u305f\u306f\u8907\u6570\u958b\u3044\u3066\u3044\u308b<\/td><td>\u672a\u4fdd\u5b58\u306e\u7df4\u7fd2\u30b3\u30d4\u30fc1\u679a\u3060\u3051\u306b\u3059\u308b<\/td><\/tr><tr><td>\u8aad\u307f\u8fbc\u307f\u524d\u306b\u505c\u6b62\u3059\u308b<\/td><td>ATN\u306e\u5b58\u5728\u30fb\u62e1\u5f35\u5b50\u30fb\u540c\u540d\u30bb\u30c3\u30c8\u30fb\u5165\u529b\u3057\u305f2\u3064\u306e\u540d\u524d<\/td><\/tr><tr><td>\u8aad\u307f\u8fbc\u3081\u305f\u304c\u518d\u751f\u3055\u308c\u306a\u3044<\/td><td>\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u306f\u306a\u304f\u5185\u90e8\u306e\u30bb\u30c3\u30c8\u540d\u30fb\u30a2\u30af\u30b7\u30e7\u30f3\u540d\u3092\u7167\u5408\u3002\u91cd\u8907\u540d\u3082\u78ba\u8a8d<\/td><\/tr><tr><td>\u518d\u751f\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u308b<\/td><td>\u8a18\u9332\u3055\u308c\u305f\u624b\u9806\u3001\u5fc5\u8981\u306a\u7d20\u6750\u30fb\u30d5\u30a9\u30f3\u30c8\u30fb\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u6587\u66f8\u6761\u4ef6\u3092\u78ba\u8a8d<\/td><\/tr><tr><td>\u30b3\u30fc\u30c9\u3092\u30e1\u30cb\u30e5\u30fc\u306b\u5e38\u8a2d\u3057\u305f\u3044<\/td><td>\u53c2\u7167\u5b9f\u884c\u3067\u78ba\u8a8d\u3057\u3066\u304b\u3089<a href=\"https:\/\/cg-method.com\/photoshop\/script-menu\/\">\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30e1\u30cb\u30e5\u30fc\u767b\u9332<\/a>\u3078\u9032\u3080<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u30a2\u30af\u30b7\u30e7\u30f3\u5185\u306e\u9014\u4e2d\u306e\u64cd\u4f5c\u304c\u6210\u529f\u3057\u3066\u304b\u3089\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3068\u3001\u7df4\u7fd2\u30b3\u30d4\u30fc\u3060\u3051\u4e00\u90e8\u304c\u5909\u308f\u3063\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u505c\u6b62\u3092\u6210\u529f\u4ef6\u6570\u306b\u52a0\u3048\u305a\u3001\u30b3\u30d4\u30fc\u3092\u4fdd\u5b58\u305b\u305a\u9589\u3058\u3001\u5143\u30b5\u30a4\u30ba\u304b\u3089\u518d\u78ba\u8a8d\u3057\u307e\u3059\u3002\u3053\u306e\u30b3\u30fc\u30c9\u306f\u81ea\u52d5\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3084\u51e6\u7406\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65e7\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u70b9\u3068\u53c2\u7167\u7528\u8a18\u9332<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e7\u4f8b\u306f\u3001ATN\u306e\u5b58\u5728\u78ba\u8a8d\u3067\u95a2\u6570\u304b\u3089\u623b\u3063\u3066\u3082\u3001\u305d\u306e\u5f8c\u306e\u518d\u751f\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u307e\u305f\u3001ATN\u30d5\u30a1\u30a4\u30eb\u540d\u7531\u6765\u306e\u6b63\u898f\u8868\u73fe\u306b\u4e00\u81f4\u3059\u308b\u30bb\u30c3\u30c8\u3092\u524a\u9664\u3057\u3066\u304b\u3089\u8aad\u307f\u8fbc\u3080\u51e6\u7406\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u4eca\u56de\u306e\u4f8b\u3067\u306f\u3001\u5931\u6557\u6642\u306e\u5f8c\u7d9a\u51e6\u7406\u3092\u6b62\u3081\u3001\u5165\u529b\u3057\u305f\u5185\u90e8\u540d\u306e\u5b8c\u5168\u4e00\u81f4\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e7\u30b3\u30fc\u30c9\u3068\u65e7\u914d\u7f6e\u5148\u306f\u7d4c\u7def\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u6b8b\u3057\u307e\u3059\u3002\u65e2\u5b58\u30bb\u30c3\u30c8\u3092\u524a\u9664\u3059\u308b\u51e6\u7406\u3092\u542b\u3080\u305f\u3081\u3001\u305d\u306e\u307e\u307e\u5b9f\u884c\u3059\u308b\u30b3\u30fc\u30c9\u3068\u3057\u3066\u4f7f\u308f\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<a href=\"https:\/\/github.com\/MOTOKI-LLC\/cg-method-code\/tree\/main\/photoshop\/iimport-and-run-action\">\u65e2\u5b58GitHub\u306e01.js<\/a>\u3082\u65e7\u4f8b\u306e\u914d\u5e03\u8a18\u9332\u3067\u3001\u3053\u306e\u30da\u30fc\u30b8\u306e\u65b0\u3057\u3044\u30b3\u30fc\u30c9\u3078\u306e\u5dee\u3057\u66ff\u3048\u306f\u884c\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u65e7\u30b3\u30fc\u30c9\u3068\u65e7\u914d\u7f6e\u5148\uff08\u53c2\u7167\u7528\u30fb\u5b9f\u884c\u3057\u306a\u3044\uff09<\/summary>\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>    var atnPath = &quot;C:\\\\Users\\\\min\\\\Desktop\\\\&quot;\n    var atn = &quot;test&quot;\n    var filePath = atnPath + atn + &quot;.atn&quot;\n    $.writeln(filePath);\n    main(); \/\/\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\n    runAtn(); \/\/\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\n\n    function runAtn() {\n        var idPly = charIDToTypeID(&quot;Ply &quot;);\n        var desc12 = new ActionDescriptor();\n        var idnull = charIDToTypeID(&quot;null&quot;);\n        var ref3 = new ActionReference();\n        var idActn = charIDToTypeID(&quot;Actn&quot;);\n        ref3.putName(idActn, &quot;glay&quot;);\n        var idASet = charIDToTypeID(&quot;ASet&quot;);\n        ref3.putName(idASet, atn);\n        desc12.putReference(idnull, ref3);\n        executeAction(idPly, desc12, DialogModes.NO);\n    }\n\n    function main() {\n        var atnFile = new File(filePath);\n        var rex = new RegExp(decodeURI(atnFile.name.replace(\/\\.[^\\.]+$\/, &#39;&#39;)), &quot;g&quot;);\n        if (!atnFile.exists) {\n            alert(&quot;ActionSet\u304c\u5b58\u5728\u3057\u307e\u305b\u3093&quot;);\n            return;\n        }\n        var actionList = getActionSets();\n        for (var d in actionList) {\n            if (decodeURI(actionList[d]).match(rex)) unLoadAction(actionList[d]);\n        }\n        app.load(atnFile);\n        var actionList = getActionSets();\n        var flag = false;\n        for (var d in actionList) {\n            if (decodeURI(actionList[d]).match(rex)) flag = true;\n        }\n        if (!flag) {\n            alert(&quot;\u30a2\u30af\u30b7\u30e7\u30f3\u30bb\u30c3\u30c8\u304c\u30ed\u30fc\u30c9\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f&quot;);\n            return;\n        }\n    }\n\n    function getActionSets() {\n        cTID = function(s) {\n            return app.charIDToTypeID(s);\n        };\n        var i = 1;\n        var sets = [];\n        while (true) {\n            var ref = new ActionReference();\n            ref.putIndex(cTID(&quot;ASet&quot;), i);\n            var desc;\n            var lvl = $.level;\n            $.level = 0;\n            try {\n                desc = executeActionGet(ref);\n            } catch (e) {\n                break;\n            } finally {\n                $.level = lvl;\n            }\n            if (desc.hasKey(cTID(&quot;Nm  &quot;))) {\n                var set = {};\n                set.index = i;\n                set.name = desc.getString(cTID(&quot;Nm  &quot;));\n                set.toString = function() {\n                    return this.name;\n                };\n                set.count = desc.getInteger(cTID(&quot;NmbC&quot;));\n                set.actions = [];\n                for (var j = 1; j &lt;= set.count; j++) {\n                    var ref = new ActionReference();\n                    ref.putIndex(cTID(&#39;Actn&#39;), j);\n                    ref.putIndex(cTID(&#39;ASet&#39;), set.index);\n                    var adesc = executeActionGet(ref);\n                    var actName = adesc.getString(cTID(&#39;Nm  &#39;));\n                    set.actions.push(actName);\n                }\n                sets.push(set);\n            }\n            i++;\n        }\n        return sets;\n    };\n\n    function unLoadAction(aSet) {\n        var desc = new ActionDescriptor();\n        var ref = new ActionReference();\n        ref.putName(charIDToTypeID(&quot;ASet&quot;), decodeURI(aSet));\n        desc.putReference(charIDToTypeID(&quot;null&quot;), ref);\n        executeAction(charIDToTypeID(&quot;Dlt &quot;), desc, DialogModes.NO);\n    };<\/code><\/pre><\/div>\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>C:\\Program Files\\Adobe\\Adobe Photoshop CC\\Presets\\Scripts<\/code><\/pre><\/div>\n\n<\/details>\n\n\n\n<p class=\"wp-block-paragraph\">\u624b\u52d5\u3067\u306e\u6301\u3061\u51fa\u3057\u306f<a href=\"https:\/\/cg-method.com\/photoshop\/photoshop-actions-atn-manage\/\">ATN\u4fdd\u5b58\u30fb\u8aad\u307f\u8fbc\u307f<\/a>\u3001\u30ad\u30fc\u304b\u3089\u306e\u518d\u751f\u306f<a href=\"https:\/\/cg-method.com\/photoshop\/action-shortcut\/\">\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8<\/a>\u3001ATN\u304b\u3089JSX\u3078\u306e\u5909\u63db\u306f<a href=\"https:\/\/cg-method.com\/photoshop\/action-to-javascript\/\">xtools\u306b\u3088\u308b\u5909\u63db\u8a18\u9332<\/a>\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u4f8b\u306f\u30d5\u30a1\u30a4\u30eb1\u3064\u306e\u8aad\u307f\u8fbc\u307f\u30681\u3064\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u518d\u751f\u3092\u5bfe\u8c61\u306b\u3057\u3001\u30d5\u30a9\u30eb\u30c0\u30fc\u4e00\u62ec\u51e6\u7406\u306f\u884c\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u78ba\u8a8d\u7bc4\u56f2\u3068\u516c\u5f0f\u8cc7\u6599<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">2026\u5e7410\u67083\u65e5\u306b\u3001Adobe\u516c\u958b\u306e<a href=\"https:\/\/github.com\/Adobe-CEP\/CEP-Resources\/blob\/master\/Documentation\/Product%20specific%20Documentation\/Photoshop%20Scripting\/photoshop-javascript-ref-2020.pdf\">Photoshop JavaScript Reference 2020<\/a>\u306eload\u30fbdoAction\u30fbexecuteActionGet\u3068\u3001<a href=\"https:\/\/helpx.adobe.com\/uk\/photoshop\/using\/playing-actions.html\">ATN\u306e\u4fdd\u5b58\u30fb\u8aad\u307f\u8fbc\u307f<\/a>\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d5\u30a1\u30a4\u30eb\u53d6\u6d88\u30fb\u5b58\u5728\u78ba\u8a8d\u30fb\u540d\u524d\u7167\u5408\u30fb\u8aad\u307f\u8fbc\u307f\u5931\u6557\u5f8c\u306e\u505c\u6b62\u3068\u65e2\u5b58\u30bb\u30c3\u30c8\u3092\u524a\u9664\u3057\u306a\u3044\u5236\u5fa1\u306f\u3001Node.js\u306e\u6a21\u64ecAPI\u3067\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u3002Photoshop\u5b9f\u6a5f\u3067\u306eATN\u8aad\u307f\u8fbc\u307f\u3001Action Manager\u306b\u3088\u308b\u4e00\u89a7\u53d6\u5f97\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u518d\u751f\u3068\u539f\u672c\u4fdd\u6301\u306f\u672a\u691c\u8a3c\u3067\u3059\u3002\u5b9f\u6a5f\u306e\u64cd\u4f5c\u753b\u9762\u306f\u4eca\u56de\u64ae\u5f71\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Photoshop\u306eJSX\u3067\u306f\u3001app.load(File)\u3067ATN\u3092\u8aad\u307f\u8fbc\u307f\u3001app.doAction(\u30a2\u30af\u30b7\u30e7\u30f3\u540d, \u30bb\u30c3\u30c8\u540d)\u3067\u8aad\u307f\u8fbc\u3093\u3060\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u518d\u751f\u3057\u307e\u3059\u3002ATN\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u3001\u5185\u90e8\u306b\u4fdd\u5b58\u3055\u308c\u305f\u30bb\u30c3\u30c8\u540d\u30fb\u30a2\u30af [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":296,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","ssp_meta_description":"Photoshop\u306eJSX\u3067ATN\u3092\u8ffd\u52a0\u3057\u3001\u30bb\u30c3\u30c8\u540d\u3068\u30a2\u30af\u30b7\u30e7\u30f3\u540d\u3092\u7167\u5408\u3057\u3066\u518d\u751f\u3059\u308b\u4f8b\u3002\u65e2\u5b58\u30bb\u30c3\u30c8\u306e\u524a\u9664\u3092\u907f\u3051\u3001\u8aad\u307f\u8fbc\u307f\u5931\u6557\u6642\u306e\u505c\u6b62\u3001\u753b\u50cf\u30b3\u30d4\u30fc\u3067\u306e\u78ba\u8a8d\u3001\u53c2\u7167\u5b9f\u884c\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002","ssp_meta_title":"Photoshop\u306eJSX\u3067ATN\u3092\u8aad\u307f\u8fbc\u307f\u30fb\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\uff5c\u30bb\u30c3\u30c8\u540d\u3068\u5931\u6557\u6642\u306e\u505c\u6b62","ssp_meta_robots":"","ssp_meta_canonical":"","ssp_meta_image":"","ssp_meta_keyword":"","book_review_data":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-action"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/comments?post=294"}],"version-history":[{"count":8,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"predecessor-version":[{"id":1429,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/294\/revisions\/1429"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media\/296"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/tags?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}