{"id":312,"date":"2025-03-19T15:49:06","date_gmt":"2025-03-19T06:49:06","guid":{"rendered":"https:\/\/cg-method.com\/photoshop\/?p=312"},"modified":"2026-10-03T09:46:24","modified_gmt":"2026-10-03T00:46:24","slug":"layer-comps-to-files-2","status":"publish","type":"post","link":"https:\/\/cg-method.com\/photoshop\/layer-comps-to-files-2\/","title":{"rendered":"Photoshop\u306e\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u66f8\u304d\u51fa\u3057\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\uff5c\u9023\u756a\u30fb\u547d\u540d\u3068JSX\u306e\u78ba\u8a8d"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u306e\u66f8\u304d\u51fa\u3057\u3067\u3001\u9023\u756a\u306e\u6709\u7121\u3084\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u533a\u5207\u308a\u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30ab\u30b9\u30bf\u30e0JSX\u3092\u691c\u8a0e\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u914d\u5e03\u5143\u306e\u30b3\u30fc\u30c9\u3068\u65e7\u63b2\u8f09\u7248\u3092\u533a\u5225\u3057\u3001\u5909\u66f4\u3059\u308b\u7b87\u6240\u3068\u78ba\u8a8d\u9805\u76ee\u3092\u6574\u7406\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30ab\u30f3\u30d7\u306e\u4f5c\u6210\u3084\u6a19\u6e96\u306e\u66f8\u304d\u51fa\u3057\u624b\u9806\u306f\u3001<a href=\"https:\/\/cg-method.com\/photoshop\/layer-comps-to-files\/\">\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u3092\u66f8\u304d\u51fa\u3059\u65b9\u6cd5<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u6a19\u6e96\u64cd\u4f5c\u3067\u8db3\u308a\u308b\u5834\u5408\u306f\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u914d\u5e03\u5143\u306e\u5b8c\u5168\u7248\u3068\u63b2\u8f09\u4f8b\u3092\u533a\u5225\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u53c2\u7167\u5143\u306f\u3001Dave Stewart\u6c0f\u306e<a href=\"https:\/\/gist.github.com\/davestewart\/4529728\">Layer Comps To Files.jsx\u306eGist<\/a>\u3067\u3059\u30022026\u5e7410\u67083\u65e5\u306e\u78ba\u8a8d\u6642\u70b9\u3067\u306f\u3001\u7d0453KB\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u30c0\u30a4\u30a2\u30ed\u30b0\u3001\u8a2d\u5b9a\u3001\u547d\u540d\u3001\u4fdd\u5b58\u306e\u51e6\u7406\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Gist\u306e\u8aac\u660e\u3067\u306f\u6570\u5024\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u4efb\u610f\u306b\u3059\u308b\u5909\u66f4\u304c\u6848\u5185\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5165\u624b\u3059\u308b\u5834\u5408\u306f\u3001\u8aac\u660e\u3060\u3051\u3067\u306a\u304f\u30d5\u30a1\u30a4\u30eb\u5168\u4f53\u3068\u66f4\u65b0\u5c65\u6b74\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u4f7f\u7528\u4e2d\u306ePhotoshop\u3078\u306e\u5bfe\u5fdc\u3068\u5b9f\u969b\u306e\u51fa\u529b\u306f\u3001\u5225\u9014\u78ba\u8a8d\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3001\u4ee5\u524d\u3053\u306e\u30da\u30fc\u30b8\u306b\u63b2\u8f09\u3057\u3066\u3044\u305f\u77ed\u3044\u30b3\u30fc\u30c9\u306f\u3001\u305d\u306e\u307e\u307e\u52d5\u304b\u305b\u308b\u5b8c\u5168\u7248\u3068\u3057\u3066\u6271\u3048\u307e\u305b\u3093\u3002\u6b21\u306e\u4e0d\u8db3\u30fb\u76f8\u9055\u3092\u672c\u6587\u3068\u30b3\u30fc\u30c9\u306e\u7167\u5408\u3067\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th>\u65e7\u63b2\u8f09\u4f8b<\/th>\n<th>\u30b3\u30fc\u30c9\u4e0a\u306e\u72b6\u614b<\/th>\n<\/tr>\n<\/thead>\n<tbody><tr>\n<td>PNG\u4fdd\u5b58\u306e\u77ed\u3044\u4f8b<\/td>\n<td><code>settingDialog<\/code> \u3068 <code>cancelButtonID<\/code> \u306e\u5b9a\u7fa9\u304c\u306a\u304f\u3001\u4fdd\u5b58\u5148\u3082\u7a7a\u6587\u5b57\u3067\u521d\u671f\u5316\u3055\u308c\u308b<\/td>\n<\/tr>\n<tr>\n<td>PNG\u4fdd\u5b58\u306e\u77ed\u3044\u4f8b\u306e\u547d\u540d<\/td>\n<td>\u756a\u53f7\u3092\u5e38\u306b\u8ffd\u52a0\u3059\u308b\u305f\u3081\u3001\u672c\u6587\u3067\u8aac\u660e\u3057\u3066\u3044\u305f\u9023\u756a\u306e\u5207\u308a\u66ff\u3048\u306f\u5b9f\u88c5\u3055\u308c\u3066\u3044\u306a\u3044<\/td>\n<\/tr>\n<tr>\n<td>\u300c\u30b5\u30fc\u30d0\u30fc\u7528\u300d\u3068\u3057\u3066\u3044\u305f\u77ed\u3044\u4f8b<\/td>\n<td>\u4fdd\u5b58\u5f62\u5f0f\u306fPSD\u56fa\u5b9a\u3067\u3001\u4fdd\u5b58\u5148\u306f\u7a7a\u6587\u5b57\u3002\u5bfe\u8a71\u3092\u4f34\u308f\u306a\u3044\u4e00\u62ec\u51e6\u7406\u3068\u3057\u3066\u5b8c\u6210\u3057\u305f\u3082\u306e\u3067\u306f\u306a\u3044<\/td>\n<\/tr>\n<tr>\n<td>\u3053\u306e\u30b5\u30a4\u30c8\u306e\u65e7\u63b2\u8f09\u9577\u6587\u7248<\/td>\n<td>\u30c0\u30a4\u30a2\u30ed\u30b0\u547c\u3073\u51fa\u3057\u3084\u8a2d\u5b9a\u306e\u8aad\u8fbc\u30fb\u4fdd\u5b58\u304c\u6b8b\u308a\u3001\u7121\u4eba\u5b9f\u884c\u3092\u78ba\u8a8d\u3057\u305f\u30b3\u30fc\u30c9\u3067\u306f\u306a\u3044<\/td>\n<\/tr>\n<\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e7\u7248\u306f\u5f8c\u534a\u306e\u6298\u308a\u305f\u305f\u307f\u6b04\u306b\u4fdd\u5b58\u3057\u3066\u3044\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306e\u6bd4\u8f03\u7528\u306e\u8cc7\u6599\u3068\u3057\u3066\u6271\u3044\u3001\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u969b\u306b\u77ed\u3044\u4f8b\u3092\u5b8c\u5168\u7248\u3068\u53d6\u308a\u9055\u3048\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"425\" alt=\"\u9023\u756a\u4ed8\u4e0e\u306e\u30aa\u30f3\u30fb\u30aa\u30d5\u3092\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u3001\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u306e\u30d5\u30a1\u30a4\u30eb\u66f8\u304d\u51fa\u3057\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u753b\u9762\u3002\" class=\"wp-image-313\" src=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/20160827204235-768x425-1-1.jpg\" srcset=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/20160827204235-768x425-1-1.jpg 768w, https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/20160827204235-768x425-1-1-300x166.jpg 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><figcaption class=\"wp-element-caption\">\u904e\u53bb\u306e\u8a18\u4e8b\u3067\u4f7f\u7528\u3057\u305f\u63b2\u8f09\u753b\u50cf\u3067\u3059\u3002\u4eca\u56de\u306ePhotoshop\u5b9f\u6a5f\u78ba\u8a8d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u9023\u756a\u3068\u533a\u5207\u308a\u6587\u5b57\u306e\u5909\u66f4\u7b87\u6240<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u914d\u5e03\u5143\u3068\u65e7\u63b2\u8f09\u9577\u6587\u7248\u3067\u306f\u3001\u51fa\u529b\u540d\u3092\u69cb\u6210\u3059\u308b\u90e8\u54c1\u3092\u914d\u5217\u3078\u8ffd\u52a0\u3059\u308b\u51e6\u7406\u304c\u3042\u308a\u307e\u3059\u3002<code>numericPrefix<\/code> \u306f\u756a\u53f7\u3092\u542b\u3081\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3059\u308b\u5024\u3067\u3001<code>zeroSuppress<\/code> \u306f\u756a\u53f7\u3092\u30bc\u30ed\u57cb\u3081\u3059\u308b\u95a2\u6570\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306f\u547d\u540d\u90e8\u5206\u306e\u8aac\u660e\u7528\u306e\u629c\u7c8b\u3067\u3059\u3002\u3053\u308c\u3060\u3051\u3092 <code>.jsx<\/code> \u306b\u4fdd\u5b58\u3057\u3066\u3082\u3001\u30ab\u30f3\u30d7\u306e\u53d6\u5f97\u30fb\u30c0\u30a4\u30a2\u30ed\u30b0\u30fb\u4fdd\u5b58\u51e6\u7406\u306f\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>var fileNameBody = [];\nif (exportInfo.fileNamePrefix) {\n    fileNameBody.push(exportInfo.fileNamePrefix);\n}\nif (exportInfo.numericPrefix) {\n    fileNameBody.push(zeroSuppress(compsIndex, 4));\n}\nif (compRef.name) {\n    fileNameBody.push(compRef.name);\n}\nif (compRef.comment) {\n    fileNameBody.push(compRef.comment);\n}\nfileNameBody = fileNameBody.join(&#x27;_&#x27;).replace(\/[:\\\/\\\\*?&quot;&lt;&gt;|\\r\\n]\/g, &#x27;_&#x27;);\n<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><code>join('_')<\/code> \u306f\u3001\u914d\u5217\u3078\u8ffd\u52a0\u3057\u305f\u90e8\u54c1\u306e\u9593\u3092\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u3067\u3064\u306a\u304e\u307e\u3059\u3002\u65e7\u63b2\u8f09\u9577\u6587\u7248\u306b\u306f <code>join('')<\/code> \u304c\u6b8b\u3063\u3066\u3044\u305f\u305f\u3081\u3001\u8aac\u660e\u306e1\u884c\u3060\u3051\u3067\u533a\u5207\u308a\u304c\u5909\u66f4\u6e08\u307f\u3068\u306f\u5224\u65ad\u3067\u304d\u307e\u305b\u3093\u3002\u5b9f\u969b\u306b\u5b9f\u884c\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u8a72\u5f53\u884c\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306e\u8868\u306f\u3001\u4e0a\u306e\u629c\u7c8b\u304b\u3089\u8a08\u7b97\u3057\u305f\u540d\u524d\u306e\u4f8b\u3067\u3059\u3002Photoshop\u3067\u4fdd\u5b58\u3057\u305f\u7d50\u679c\u3067\u306f\u306a\u304f\u3001\u62e1\u5f35\u5b50\u3092\u52a0\u3048\u308b\u524d\u306e\u6587\u5b57\u5217\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u30b3\u30e1\u30f3\u30c8\u306f\u7a7a\u3001\u756a\u53f7\u306f0\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th>\u63a5\u982d\u8f9e<\/th>\n<th>\u9023\u756a<\/th>\n<th>\u30ab\u30f3\u30d7\u540d<\/th>\n<th>\u8a08\u7b97\u4e0a\u306e\u540d\u524d<\/th>\n<\/tr>\n<\/thead>\n<tbody><tr>\n<td><code>ui<\/code><\/td>\n<td>\u542b\u3081\u308b<\/td>\n<td><code>home<\/code><\/td>\n<td><code>ui_0000_home<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>ui<\/code><\/td>\n<td>\u542b\u3081\u306a\u3044<\/td>\n<td><code>home<\/code><\/td>\n<td><code>ui_home<\/code><\/td>\n<\/tr>\n<tr>\n<td>\u7a7a<\/td>\n<td>\u542b\u3081\u306a\u3044<\/td>\n<td><code>home<\/code><\/td>\n<td><code>home<\/code><\/td>\n<\/tr>\n<\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u30ab\u30f3\u30d7\u540d\u306e\u5f8c\u308d\u306b001\u304c\u4ed8\u304f\u300d\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002\u3053\u306e\u4f8b\u3067\u306f\u63a5\u982d\u8f9e\u3001\u756a\u53f7\u3001\u30ab\u30f3\u30d7\u540d\u3001\u30b3\u30e1\u30f3\u30c8\u306e\u9806\u3067\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u9023\u756a\u3092\u5916\u3059\u524d\u306b\u540c\u540d\u3092\u78ba\u8a8d\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u9023\u756a\u3092\u5916\u3059\u3068\u3001\u540c\u3058\u30ab\u30f3\u30d7\u540d\u3092\u533a\u5225\u3059\u308b\u60c5\u5831\u304c\u6e1b\u308a\u307e\u3059\u3002\u3055\u3089\u306b\u8a18\u53f7\u306e\u7f6e\u63db\u3084\u5c0f\u6587\u5b57\u5316\u3092\u884c\u3046\u3068\u3001\u5143\u306e\u540d\u524d\u304c\u9055\u3063\u3066\u3044\u3066\u3082\u51fa\u529b\u540d\u304c\u540c\u3058\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th>\u5143\u306e\u540d\u524d\u306e\u4f8b<\/th>\n<th>\u78ba\u8a8d\u304c\u5fc5\u8981\u306a\u7406\u7531<\/th>\n<\/tr>\n<\/thead>\n<tbody><tr>\n<td><code>home<\/code> \u3068 <code>home<\/code><\/td>\n<td>\u9023\u756a\u3092\u5916\u3059\u3068\u540c\u3058\u540d\u524d\u306b\u306a\u308b<\/td>\n<\/tr>\n<tr>\n<td><code>a\/b<\/code> \u3068 <code>a:b<\/code><\/td>\n<td>\u3069\u3061\u3089\u3082\u8a18\u53f7\u306e\u7f6e\u63db\u5f8c\u306b <code>a_b<\/code> \u306b\u306a\u308b<\/td>\n<\/tr>\n<tr>\n<td><code>Home<\/code> \u3068 <code>home<\/code><\/td>\n<td>\u5c0f\u6587\u5b57\u5316\u3092\u9078\u3076\u3068\u533a\u5225\u304c\u306a\u304f\u306a\u308b<\/td>\n<\/tr>\n<tr>\n<td>\u5148\u982d\u90e8\u5206\u304c\u540c\u3058\u9577\u3044\u540d\u524d<\/td>\n<td>\u65e7\u63b2\u8f09\u9577\u6587\u7248\u306e120\u6587\u5b57\u3078\u306e\u5207\u308a\u8a70\u3081\u3067\u540c\u3058\u540d\u524d\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b<\/td>\n<\/tr>\n<\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u6b63\u898f\u8868\u73fe\u306f\u4e00\u90e8\u306e\u8a18\u53f7\u3092\u7f6e\u63db\u3059\u308b\u51e6\u7406\u3067\u3059\u3002\u7a7a\u306e\u540d\u524d\u3084OS\u306e\u4e88\u7d04\u540d\u3001\u4fdd\u5b58\u5148\u3092\u542b\u3081\u305f\u30d1\u30b9\u306e\u9577\u3055\u307e\u3067\u4fdd\u8a3c\u3059\u308b\u691c\u67fb\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u547d\u540d\u3092\u5909\u3048\u308b\u5834\u5408\u306f\u3001\u51fa\u529b\u5bfe\u8c61\u5168\u4ef6\u306e\u6700\u7d42\u540d\u3092\u6bd4\u8f03\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6a19\u6e96\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4e0a\u66f8\u304d\u305b\u305a\u306b\u78ba\u8a8d\u3059\u308b<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u914d\u5e03\u5143\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u5168\u4f53\u3092\u53d6\u5f97\u3057\u3001\u51fa\u6240\u3068\u66f4\u65b0\u65e5\u6642\u3092\u8a18\u9332\u3057\u307e\u3059\u3002<\/li>\n\n<li>\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u7ba1\u3057\u3001\u5909\u66f4\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u5225\u540d\u306e\u30b3\u30d4\u30fc\u306b\u3057\u307e\u3059\u3002<\/li>\n\n<li>\u30ab\u30f3\u30d7\u30922\u301c3\u4ef6\u3060\u3051\u542b\u3080\u3001\u8a66\u9a13\u7528PSD\u306e\u30b3\u30d4\u30fc\u3092\u958b\u304d\u307e\u3059\u3002<\/li>\n\n<li>\uff3b\u30d5\u30a1\u30a4\u30eb\uff3d\u2192\uff3b\u30b9\u30af\u30ea\u30d7\u30c8\uff3d\u2192\uff3b\u53c2\u7167\uff3d\u304b\u3089\u3001\u8a66\u9a13\u3059\u308b <code>.jsx<\/code> \u3092\u9078\u3073\u307e\u3059\u3002<\/li>\n\n<li>\u7a7a\u306e\u51fa\u529b\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u4f7f\u3044\u3001\u756a\u53f7\u306e\u6709\u7121\u3068\u51fa\u529b\u540d\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n\n<li>\u5185\u5bb9\u30fb\u30b5\u30a4\u30ba\u30fb\u900f\u660e\u5ea6\u30fb\u51fa\u529b\u6570\u3082\u78ba\u8a8d\u3057\u3066\u304b\u3089\u5bfe\u8c61\u3092\u5897\u3084\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u521d\u56de\u5b9f\u884c\u3068\u30e1\u30cb\u30e5\u30fc\u3078\u306e\u767b\u9332\u306f\u3001<a href=\"https:\/\/cg-method.com\/photoshop\/external-jsx\/\">JSX\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5<\/a>\u3067\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u3002Photoshop\u4ed8\u5c5e\u306e\u6a19\u6e96\u30d5\u30a1\u30a4\u30eb\u3092\u76f4\u63a5\u66f8\u304d\u63db\u3048\u305a\u3001\u5909\u66f4\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u533a\u5225\u3057\u3066\u7ba1\u7406\u3057\u307e\u3059\u3002<a href=\"https:\/\/helpx.adobe.com\/jp\/photoshop\/using\/scripting.html\">Adobe\u516c\u5f0f\uff1a\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u300c\u30b5\u30fc\u30d0\u30fc\u7528\u300d\u3068\u7121\u4eba\u5b9f\u884c\u306e\u9055\u3044<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u524d\u306e\u300c\u30b5\u30fc\u30d0\u30fc\u7528\u300d\u3068\u3044\u3046\u898b\u51fa\u3057\u306f\u3001\u7121\u4eba\u3067\u5b9f\u884c\u3067\u304d\u308b\u3053\u3068\u3092\u793a\u3059\u6839\u62e0\u306b\u306f\u306a\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u65e7\u63b2\u8f09\u9577\u6587\u7248\u306b\u306f <code>settingDialog<\/code> \u306e\u547c\u3073\u51fa\u3057\u3001<code>getCustomOptions<\/code>\u3001<code>putCustomOptions<\/code> \u304c\u6b8b\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bfe\u8a71\u306a\u3057\u3067\u4f7f\u3046\u306b\u306f\u3001\u4fdd\u5b58\u5148\u30fb\u5f62\u5f0f\u30fb\u5bfe\u8c61\u30ab\u30f3\u30d7\u306a\u3069\u3092\u3069\u3053\u304b\u3089\u53d7\u3051\u53d6\u308b\u304b\u3001\u540c\u540d\u30d5\u30a1\u30a4\u30eb\u3092\u3069\u3046\u6271\u3046\u304b\u3001\u5931\u6557\u6642\u306b\u8907\u88fd\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3084\u8a2d\u5b9a\u3092\u3069\u3046\u623b\u3059\u304b\u3092\u6c7a\u3081\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u901a\u5e38\u306ePhotoshop\u7528JSX\u3092\u3001Photoshop\u3092\u8d77\u52d5\u305b\u305a\u306b\u753b\u50cf\u5909\u63db\u3059\u308b\u4ed5\u7d44\u307f\u3068\u3057\u3066\u306f\u6848\u5185\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65e7\u63b2\u8f09\u30b3\u30fc\u30c9\u306e\u4fdd\u5b58\u5148<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30b5\u30a4\u30c8\u306e\u904e\u53bb\u306e\u30b3\u30fc\u30c9\u306f\u3001<a href=\"https:\/\/github.com\/MOTOKI-LLC\/cg-method-code\/tree\/main\/photoshop\/layer-comps-to-files\">\u6a19\u6e96\u8a18\u4e8b\u5074\u306e\u4fdd\u5b58\u5148<\/a>\u3068<a href=\"https:\/\/github.com\/MOTOKI-LLC\/cg-method-code\/tree\/main\/photoshop\/layer-comps-to-files-2\">\u30ab\u30b9\u30bf\u30e0\u8a18\u4e8b\u5074\u306e\u4fdd\u5b58\u5148<\/a>\u306b\u3082\u3042\u308a\u307e\u3059\u30022026\u5e7410\u67083\u65e5\u306b\u78ba\u8a8d\u3057\u305f\u5f8c\u8005\u306e <code>01.js<\/code> \u3068 <code>02.txt<\/code> \u306f\u3001\u4e0a\u8a18\u306e\u77ed\u3044\u63b2\u8f09\u4f8b\u306b\u5bfe\u5fdc\u3057\u307e\u3059\u3002\u62e1\u5f35\u5b50\u3092\u5909\u3048\u308b\u3060\u3051\u3067\u306f\u3001\u6b20\u3051\u305f\u51e6\u7406\u306f\u88dc\u308f\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6a19\u6e96\u8a18\u4e8b\u306b\u3042\u3063\u305f\u9577\u6587\u7248\u3082\u3001\u56fa\u6709\u306e\u30b3\u30fc\u30c9\u3092\u5931\u308f\u306a\u3044\u3088\u3046\u3001\u3053\u306e\u30da\u30fc\u30b8\u306e\u6298\u308a\u305f\u305f\u307f\u6b04\u3078\u79fb\u3057\u3066\u3044\u307e\u3059\u3002\u65e7\u7248\u306f\u6539\u5909\u305b\u305a\u3001\u914d\u5e03\u5143\u306e\u73fe\u884c\u30d5\u30a1\u30a4\u30eb\u3068\u533a\u5225\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u78ba\u8a8d\u3057\u305f\u7bc4\u56f2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u56de\u306e\u66f4\u65b0\u3067\u306f\u3001\u63b2\u8f09\u30b3\u30fc\u30c9\u3068\u914d\u5e03\u5143\u306e\u5185\u5bb9\u3092\u8aad\u3093\u3067\u6bd4\u8f03\u3057\u307e\u3057\u305f\u3002Photoshop\u5b9f\u6a5f\u3067\u306e\u5b9f\u884c\u3001\u9023\u756a\u306e\u5207\u308a\u66ff\u3048\u3001\u51fa\u529b\u753b\u50cf\u306e\u4e00\u81f4\u3001\u901f\u5ea6\u306f\u672a\u78ba\u8a8d\u3067\u3059\u3002\u63b2\u8f09\u753b\u50cf\u306f\u904e\u53bb\u306e\u8a18\u4e8b\u3067\u4f7f\u3063\u305f\u753b\u9762\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65e7\u63b2\u8f09\u30b3\u30fc\u30c9\u306e\u6bd4\u8f03\u8cc7\u6599<\/h2>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u65e7\u6a19\u6e96\u8a18\u4e8b\u306b\u63b2\u8f09\u3057\u305f\u9577\u6587\u7248\uff08\u79fb\u8a2d\u30fb\u5b9f\u6a5f\u672a\u691c\u8a3c\uff09<\/summary>\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\n$.localize = true;\n\n\/\/=================================================================\n\/\/ Globals\n\/\/=================================================================\n\n\/\/ UI strings to be localized\nvar strTitle = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Title=Layer Comps To Files&quot;);\nvar strButtonRun = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Run=Run&quot;);\nvar strButtonCancel = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Cancel=Cancel&quot;);\nvar strHelpText = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Help=Please specify the format and location for saving each layer comp as a file.&quot;);\nvar strLabelDestination = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Destination=Destination:&quot;);\nvar strButtonBrowse = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Browse=&Browse...&quot;);\nvar strLabelFileNamePrefix = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/FileNamePrefix=File Name Prefix:&quot;);\nvar strCheckboxSelectionOnly = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/SelectedOnly=&Selected Layer Comps Only&quot;);\nvar strCheckboxNumericPrefix = &#39;Add &Numeric Prefix&#39;;\nvar strCheckboxLowerCase = &#39;Save Lowercase Filename&#39;;\nvar strLabelFileType = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/FileType=File Type:&quot;);\nvar strCheckboxIncludeICCProfile = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/IncludeICC=&Include ICC Profile&quot;);\nvar strJPEGOptions = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/JPEGOptions=JPEG Options:&quot;);\nvar strLabelQuality = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Quality=Quality:&quot;);\nvar strPSDOptions = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/PSDOptions=PSD Options:&quot;);\nvar strCheckboxMaximizeCompatibility = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Maximize=&Maximize Compatibility&quot;);\nvar strTIFFOptions = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/TIFFOptions=TIFF Options:&quot;);\nvar strLabelImageCompression = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/ImageCompression=Image Compression:&quot;);\nvar strNone = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/None=None&quot;);\nvar strPDFOptions = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/PDFOptions=PDF Options:&quot;);\nvar strLabelEncoding = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Encoding=Encoding:&quot;);\nvar strTargaOptions = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/TargaOptions=Targa Options:&quot;);\nvar strLabelDepth = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Depth=Depth:&quot;);\nvar strRadiobutton16bit = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Bit16=16bit&quot;);\nvar strRadiobutton24bit = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Bit24=24bit&quot;);\nvar strRadiobutton32bit = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Bit32=32bit&quot;);\nvar strBMPOptions = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/BMPOptions=BMP Options:&quot;);\nvar strAlertSpecifyDestination = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/SpecifyDestination=Please specify destination.&quot;);\nvar strAlertDestinationNotExist = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/DestionationDoesNotExist=Destination does not exist.&quot;);\nvar strTitleSelectDestination = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/SelectDestination=Select Destination&quot;);\nvar strAlertDocumentMustBeOpened = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/OneDocument=You must have a document open to export!&quot;);\nvar strAlertNoLayerCompsFound = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/NoComps=No layer comps found in document!&quot;);\nvar strAlertWasSuccessful = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Success= was successful.&quot;);\nvar strUnexpectedError = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Unexpectedd=Unexpected error&quot;);\nvar strMessage = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Message=Layer Comps To Files action settings&quot;);\nvar\tstretQuality = localize( &quot;$$$\/locale_specific\/JavaScripts\/LayerCompsToFiles\/ETQualityLength=30&quot; );\nvar\tstretDestination = localize( &quot;$$$\/locale_specific\/JavaScripts\/LayerCompsToFiles\/ETDestinationLength=160&quot; );\nvar\tstrddFileType = localize( &quot;$$$\/locale_specific\/JavaScripts\/LayerCompsToFiles\/DDFileType=100&quot; );\nvar\tstrpnlOptions = localize( &quot;$$$\/locale_specific\/JavaScripts\/LayerCompsToFiles\/PNLOptions=100&quot; );\nvar\tstrCreateFolder = localize( &quot;$$$\/JavaScripts\/LayerCompsToFiles\/CreateFolder=The folder does not exist. Do you wish to create it?^r&quot; );\nvar\tstrCouldNotCreate = localize( &quot;$$$\/JavaScripts\/LayerCompsToFiles\/CouldNotCreate=The folder could not be created.&quot; );\nvar strPNG8Options = localize(&quot;$$$\/JavaScripts\/ExportLayersToFiles\/PNG8Options=PNG-8 Options:&quot;);\nvar strCheckboxPNGTransparency = localize(&quot;$$$\/JavaScripts\/ExportLayersToFiles\/Transparency=Transparency&quot;);\nvar strCheckboxPNGInterlaced = localize(&quot;$$$\/JavaScripts\/ExportLayersToFiles\/Interlaced=Interlaced&quot;);\nvar strPNG24Options = localize(&quot;$$$\/JavaScripts\/ExportLayersToFiles\/PNG24Options=PNG-24 Options:&quot;);\n\n\/\/ the drop down list indexes for file type\nvar bmpIndex = 0;\nvar jpegIndex = 1;\nvar pdfIndex = 2;\nvar psdIndex = 3;\nvar targaIndex = 4;\nvar tiffIndex = 5;\nvar png8Index = 6;\nvar png24Index = 7;\n\n\/\/ the drop down list indexes for tiff compression\nvar compNoneIndex = 0;\nvar compLZWIndex = 1;\nvar compZIPIndex = 2;\nvar compJPEGIndex = 3;\n\n\/\/ ok and cancel button\nvar runButtonID = 1;\nvar cancelButtonID = 2;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Dispatch\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nmain();\n\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Functions\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: main\n\/\/ Usage: the core routine for this script\n\/\/ Input: &lt;none&gt;\n\/\/ Return: &lt;none&gt;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction main() {\n\n    if ( app.documents.length &lt;= 0 ) {\n        if ( DialogModes.NO != app.playbackDisplayDialogs ) {\n            alert( strAlertDocumentMustBeOpened );\n        }\n    \treturn &#39;cancel&#39;; \/\/ quit, returning &#39;cancel&#39; (dont localize) makes the actions palette not record our script\n    }\n\n    var exportInfo = new Object();\n\n    initExportInfo(exportInfo);\n\n \t\/\/ look for last used params via Photoshop registry, getCustomOptions will throw if none exist\n\ttry {\n\t\tvar d = app.getCustomOptions(&quot;d69fc733-75b4-4d5c-ae8a-c6d6f9a8aa32&quot;);\n\t\tdescriptorToObject(exportInfo, d, strMessage, postProcessExportInfo);\n\t}\n\tcatch(e) {\n\t\t\/\/ it&#39;s ok if we don&#39;t have any options, continue with defaults\n\t}\n\n\t\/\/ see if I am getting descriptor parameters\n    descriptorToObject(exportInfo, app.playbackParameters, strMessage, postProcessExportInfo);\n        $.writeln(&quot;\u3042\u3042\u3042\u3042\u3042\u3042\u3042\u3042\u3042\u3042\u3042\u3042\u3042\u3042\u3042\u3042&quot;);\n \/\/   if ( DialogModes.ALL == app.playbackDisplayDialogs ) {\n\n    \tif (cancelButtonID == settingDialog(exportInfo)) {\n\t    \treturn &#39;cancel&#39;; \/\/ quit, returning &#39;cancel&#39; (dont localize) makes the actions palette not record our script\n\t    }\n\t\/\/}\n\n        var docName = app.activeDocument.name;  \/\/ save the app.activeDocument name before duplicate.\n        var compsName = new String(&quot;none&quot;);\n        var compsCount = app.activeDocument.layerComps.length;\n        if ( compsCount &lt; 1 ) {\n            if ( DialogModes.NO != app.playbackDisplayDialogs ) {\n                alert ( strAlertNoLayerCompsFound );\n            }\n\t    \treturn &#39;cancel&#39;; \/\/ quit, returning &#39;cancel&#39; (dont localize) makes the actions palette not record our script\n        } else {\n            app.activeDocument = app.documents[docName];\n            docRef = app.activeDocument;\n\n            var rememberMaximize;\n            var needMaximize = exportInfo.psdMaxComp ? QueryStateType.ALWAYS : QueryStateType.NEVER;\n            if ( exportInfo.fileType == psdIndex && app.preferences.maximizeCompatibility != needMaximize ) {\n                rememberMaximize = app.preferences.maximizeCompatibility;\n                app.preferences.maximizeCompatibility = needMaximize;\n            }\n\n            for ( compsIndex = 0; compsIndex &lt; compsCount; compsIndex++ ) {\n                var compRef = docRef.layerComps[ compsIndex ];\n                if (exportInfo.selectionOnly && !compRef.selected) continue; \/\/ selected only\n                compRef.apply();\n                var duppedDocument = app.activeDocument.duplicate();\n\n\t\t\t\t\/*\n\t\t\t\t\t\/\/ OLD\n\t\t\t\t\tvar fileNameBody = exportInfo.fileNamePrefix;\n\t\t\t\t\tfileNameBody += &quot;_&quot; + zeroSuppress(compsIndex, 4);\n\t\t\t\t\tfileNameBody += &quot;_&quot; + compRef.name;\n\t\t\t\t\tif (null != compRef.comment)    fileNameBody += &quot;_&quot; + compRef.comment;\n                *\/\n\n\t\t\t\t\/\/ NEW\n\t\t\t\tvar fileNameBody = [];\n\t\t\t\tif(exportInfo.fileNamePrefix)\n\t\t\t\t{\n\t\t\t\t\tfileNameBody.push(exportInfo.fileNamePrefix);\n\t\t\t\t}\n\t\t\t\tif(exportInfo.numericPrefix)\n\t\t\t\t{\n\t\t\t\t\tfileNameBody.push(zeroSuppress(compsIndex, 4));\n\t\t\t\t}\n\t\t\t\tif(compRef.name)\n\t\t\t\t{\n\t\t\t\t\tfileNameBody.push(compRef.name);\n\t\t\t\t}\n\t\t\t\tif(compRef.comment)\n\t\t\t\t{\n\t\t\t\t\tfileNameBody.push(compRef.comment);\n\t\t\t\t}\n                fileNameBody = fileNameBody.join(&#39;&#39;).replace(\/[:\\\/\\\\*\\?\\&quot;\\&lt;\\&gt;\\|\\\\\\r\\\\\\n]\/g, &quot;_&quot;);  \/\/ &#39;\/\\:*?&quot;&lt;&gt;|\\r\\n&#39; -&gt; &#39;_&#39;\n\t\t\t\tif(exportInfo.lowerCase)\n\t\t\t\t{\n\t\t\t\t\tfileNameBody = fileNameBody.toLowerCase();\n\t\t\t\t}\n\n\n                if (fileNameBody.length &gt; 120) fileNameBody = fileNameBody.substring(0,120);\n                saveFile(duppedDocument, fileNameBody, exportInfo);\n                duppedDocument.close(SaveOptions.DONOTSAVECHANGES);\n            }\n\n\t\t\tvar d = objectToDescriptor(exportInfo, strMessage, preProcessExportInfo);\n \t        app.putCustomOptions(&quot;d69fc733-75b4-4d5c-ae8a-c6d6f9a8aa32&quot;, d);\n\n\t\t\tvar dd = objectToDescriptor(exportInfo, strMessage, preProcessExportInfo);\n            app.playbackParameters = dd;\n\n            if ( rememberMaximize != undefined ) {\n                app.preferences.maximizeCompatibility = rememberMaximize;\n            }\n\n            if ( DialogModes.ALL == app.playbackDisplayDialogs ) {\n                alert(strTitle + strAlertWasSuccessful);\n            }\n\n            app.playbackDisplayDialogs = DialogModes.ALL;\n\n        }\n    }\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: settingDialog\n\/\/ Usage: pop the ui and get user settings\n\/\/ Input: exportInfo object containing our parameters\n\/\/ Return: on ok, the dialog info is set to the exportInfo object\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nfunction settingDialog(exportInfo)\n\n{        \n\n    dlgMain = new Window(&quot;dialog&quot;, strTitle);\n\n    \/\/ match our dialog background color to the host application\n\tvar brush = dlgMain.graphics.newBrush(dlgMain.graphics.BrushType.THEME_COLOR, &quot;appDialogBackground&quot;);\n    dlgMain.graphics.backgroundColor = brush;\n    dlgMain.graphics.disabledBackgroundColor = brush;\n\n\tdlgMain.orientation = &#39;column&#39;;\n\tdlgMain.alignChildren = &#39;left&#39;;\n\n\t\/\/ -- top of the dialog, first line\n    dlgMain.add(&quot;statictext&quot;, undefined, strLabelDestination);\n\n\t\/\/ -- two groups, one for left and one for right ok, cancel\n\tdlgMain.grpTop = dlgMain.add(&quot;group&quot;);\n\tdlgMain.grpTop.orientation = &#39;row&#39;;\n\tdlgMain.grpTop.alignChildren = &#39;top&#39;;\n\tdlgMain.grpTop.alignment = &#39;fill&#39;;\n\n\t\/\/ -- group top left\n\tdlgMain.grpTopLeft = dlgMain.grpTop.add(&quot;group&quot;);\n\tdlgMain.grpTopLeft.orientation = &#39;column&#39;;\n\tdlgMain.grpTopLeft.alignChildren = &#39;left&#39;;\n\tdlgMain.grpTopLeft.alignment = &#39;fill&#39;;\n\n\t\/\/ -- the second line in the dialog\n\tdlgMain.grpSecondLine = dlgMain.grpTopLeft.add(&quot;group&quot;);\n\tdlgMain.grpSecondLine.orientation = &#39;row&#39;;\n\tdlgMain.grpSecondLine.alignChildren = &#39;center&#39;;\n\n    dlgMain.etDestination = dlgMain.grpSecondLine.add(&quot;edittext&quot;, undefined, exportInfo.destination.toString());\n    dlgMain.etDestination.preferredSize.width = StrToIntWithDefault( stretDestination, 160 );\n\n    dlgMain.btnBrowse = dlgMain.grpSecondLine.add(&quot;button&quot;, undefined, strButtonBrowse);\n    dlgMain.btnBrowse.onClick = function() {\n\t\tvar defaultFolder = dlgMain.etDestination.text;\n\t\tvar testFolder = new Folder(dlgMain.etDestination.text);\n\t\tif (!testFolder.exists) defaultFolder = &quot;~&quot;;\n\t\tvar selFolder = Folder.selectDialog(strTitleSelectDestination, defaultFolder);\n\t\tif ( selFolder != null ) {\n\t        dlgMain.etDestination.text = selFolder.fsName;\n\t    }\n\t\tdlgMain.defaultElement.active = true;\n\t}\n\n\t\/\/ -- the third line in the dialog\n    dlgMain.grpTopLeft.add(&quot;statictext&quot;, undefined, strLabelFileNamePrefix);\n\n\t\/\/ -- the fourth line in the dialog\n    dlgMain.etFileNamePrefix = dlgMain.grpTopLeft.add(&quot;edittext&quot;, undefined, exportInfo.fileNamePrefix.toString());\n    dlgMain.etFileNamePrefix.alignment = &#39;fill&#39;;\n    dlgMain.etFileNamePrefix.preferredSize.width = StrToIntWithDefault( stretDestination, 160 );\n\n\t\/\/ -- the fifth line in the dialog\n    dlgMain.cbSelection = dlgMain.grpTopLeft.add(&quot;checkbox&quot;, undefined, strCheckboxSelectionOnly);\n    dlgMain.cbSelection.value = exportInfo.selectionOnly;\n\n\t\/\/ -- the fifth line in the dialog\n    dlgMain.cbNumericPrefix = dlgMain.grpTopLeft.add(&quot;checkbox&quot;, undefined, strCheckboxNumericPrefix);\n    dlgMain.cbNumericPrefix.value = exportInfo.numericPrefix;\n\n\t\/\/ -- the fifth line in the dialog\n    dlgMain.cbLowerCase = dlgMain.grpTopLeft.add(&quot;checkbox&quot;, undefined, strCheckboxLowerCase);\n    dlgMain.cbLowerCase.value = exportInfo.lowerCase;\n\n\t\/\/ -- the sixth line is the panel\n    dlgMain.pnlFileType = dlgMain.grpTopLeft.add(&quot;panel&quot;, undefined, strLabelFileType);\n\tdlgMain.pnlFileType.alignment = &#39;fill&#39;;\n\n    \/\/ -- now a dropdown list\n    dlgMain.ddFileType = dlgMain.pnlFileType.add(&quot;dropdownlist&quot;);\n    dlgMain.ddFileType.preferredSize.width = StrToIntWithDefault( strddFileType, 100 );\n    dlgMain.ddFileType.alignment = &#39;left&#39;;\n\n    dlgMain.ddFileType.add(&quot;item&quot;, &quot;BMP&quot;);\n    dlgMain.ddFileType.add(&quot;item&quot;, &quot;JPEG&quot;);\n    dlgMain.ddFileType.add(&quot;item&quot;, &quot;PDF&quot;);\n\tdlgMain.ddFileType.add(&quot;item&quot;, &quot;PSD&quot;);\n    dlgMain.ddFileType.add(&quot;item&quot;, &quot;Targa&quot;);\n    dlgMain.ddFileType.add(&quot;item&quot;, &quot;TIFF&quot;);\n    dlgMain.ddFileType.add(&quot;item&quot;, &quot;PNG-8&quot;);\n    dlgMain.ddFileType.add(&quot;item&quot;, &quot;PNG-24&quot;);\n\n\tdlgMain.ddFileType.onChange = function() {\n\t\thideAllFileTypePanel();\n\t\tswitch(this.selection.index) {\n\t\t\tcase bmpIndex:\n\t\t\t\t\/\/  dlgMain.pnlFileType.pnlOptions.text = strBMPOptions;\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.grpBMPOptions.show();\n\t\t\t\tbreak;\n\t\t\tcase jpegIndex:\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.text = strJPEGOptions;\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.show();\n\t\t\t\tbreak;\n\t\t\tcase tiffIndex:\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.text = strTIFFOptions;\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.show();\n\t\t\t\tbreak;\n\t\t\tcase pdfIndex:\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.text = strPDFOptions;\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.grpPDFOptions.show();\n\t\t\t\tbreak;\n\t\t\tcase targaIndex:\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.text = strTargaOptions;\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.grpTargaOptions.show();\n\t\t\t\tbreak;\n\t\t\tcase png8Index:\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.text = strPNG8Options;\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.grpPNG8Options.show();\n\t\t\t\tbreak;\n\t\t\tcase png24Index:\n\t\t\t\t\/\/lgMain.pnlFileType.pnlOptions.text = strPNG24Options;\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.grpPNG24Options.show();\n\t\t\t\tbreak;\n\t\t\tcase psdIndex:\n\t\t\tdefault:\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.text = strPSDOptions;\n\t\t\t\t\/\/dlgMain.pnlFileType.pnlOptions.grpPSDOptions.show();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n    dlgMain.ddFileType.items[exportInfo.fileType].selected = true;\n\n\t\/\/ -- now after all the radio buttons\n    dlgMain.cbIcc = dlgMain.pnlFileType.add(&quot;checkbox&quot;, undefined, strCheckboxIncludeICCProfile);\n    dlgMain.cbIcc.value = exportInfo.icc;\n    dlgMain.cbIcc.alignment = &#39;left&#39;;\n\n\t\/\/ -- now the options panel that changes\n    dlgMain.pnlFileType.pnlOptions = dlgMain.pnlFileType.add(&quot;panel&quot;, undefined, &quot;Options&quot;);\n    dlgMain.pnlFileType.pnlOptions.alignment = &#39;fill&#39;;\n    dlgMain.pnlFileType.pnlOptions.orientation = &#39;stack&#39;;\n    dlgMain.pnlFileType.pnlOptions.preferredSize.height = StrToIntWithDefault( strpnlOptions, 100 );\n\n\t\/\/ PSD options\n    dlgMain.pnlFileType.pnlOptions.grpPSDOptions = dlgMain.pnlFileType.pnlOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpPSDOptions.cbMax = dlgMain.pnlFileType.pnlOptions.grpPSDOptions.add(&quot;checkbox&quot;, undefined, strCheckboxMaximizeCompatibility);\n    dlgMain.pnlFileType.pnlOptions.grpPSDOptions.cbMax.value = exportInfo.psdMaxComp;\n\tdlgMain.pnlFileType.pnlOptions.grpPSDOptions.visible = (exportInfo.fileType == psdIndex);\n\n    \/\/ PNG8 options\n    dlgMain.pnlFileType.pnlOptions.grpPNG8Options = dlgMain.pnlFileType.pnlOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Trans = dlgMain.pnlFileType.pnlOptions.grpPNG8Options.add(&quot;checkbox&quot;, undefined, strCheckboxPNGTransparency.toString());\n    dlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Inter = dlgMain.pnlFileType.pnlOptions.grpPNG8Options.add(&quot;checkbox&quot;, undefined, strCheckboxPNGInterlaced.toString());\n    dlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Trans.value = exportInfo.png8Transparency;\n    dlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Inter.value = exportInfo.png8Interlaced;\n    dlgMain.pnlFileType.pnlOptions.grpPNG8Options.visible = (exportInfo.fileType == png8Index);\n\n    \/\/ PNG24 options\n    dlgMain.pnlFileType.pnlOptions.grpPNG24Options = dlgMain.pnlFileType.pnlOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trans = dlgMain.pnlFileType.pnlOptions.grpPNG24Options.add(&quot;checkbox&quot;, undefined, strCheckboxPNGTransparency.toString());\n    dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter = dlgMain.pnlFileType.pnlOptions.grpPNG24Options.add(&quot;checkbox&quot;, undefined, strCheckboxPNGInterlaced.toString());\n    dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trans.value = exportInfo.png24Transparency;\n    dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value = exportInfo.png24Interlaced;\n    dlgMain.pnlFileType.pnlOptions.grpPNG24Options.visible = (exportInfo.fileType == png24Index);\n\n\t\/\/ JPEG options\n    dlgMain.pnlFileType.pnlOptions.grpJPEGOptions = dlgMain.pnlFileType.pnlOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.add(&quot;statictext&quot;, undefined, strLabelQuality);\n    dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.etQuality = dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.add(&quot;edittext&quot;, undefined, exportInfo.jpegQuality.toString());\n    dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.etQuality.preferredSize.width = StrToIntWithDefault( stretQuality, 30 );\n    dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.visible = (exportInfo.fileType == jpegIndex);\n\n\t\/\/ TIFF options\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions = dlgMain.pnlFileType.pnlOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.orientation = &#39;column&#39;;\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.visible = (exportInfo.fileType == tiffIndex);\n\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression = dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.alignment = &#39;left&#39;;\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.add(&quot;statictext&quot;, undefined, strLabelImageCompression);\n\n\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.ddCompression = dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.add(&quot;dropdownlist&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.ddCompression.add(&quot;item&quot;, strNone);\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.ddCompression.add(&quot;item&quot;, &quot;LZW&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.ddCompression.add(&quot;item&quot;, &quot;ZIP&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.ddCompression.add(&quot;item&quot;, &quot;JPEG&quot;);\n\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.ddCompression.onChange = function() {\n\t\tif (this.selection.index == compJPEGIndex) {\n\t\t\tdlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.stQuality.enabled = true;\n\t\t\tdlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.etQuality.enabled = true;\n\t\t} else {\n\t\t\tdlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.stQuality.enabled = false;\n\t\t\tdlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.etQuality.enabled = false;\n\t\t}\n    }\n\n\tdlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality = dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.alignment = &#39;left&#39;;\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.stQuality = dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.add(&quot;statictext&quot;, undefined, strLabelQuality);\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.etQuality = dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.add(&quot;edittext&quot;, undefined, exportInfo.tiffJpegQuality.toString());\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.etQuality.preferredSize.width = StrToIntWithDefault( stretQuality, 30 );\n\tdlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.etQuality.graphics.disabledBackgroundColor = brush;\n\n\tvar index;\n    switch (exportInfo.tiffCompression) {\n\t\tcase TIFFEncoding.NONE:     index = compNoneIndex; break;\n        case TIFFEncoding.TIFFLZW:  index = compLZWIndex; break;\n        case TIFFEncoding.TIFFZIP:  index = compZIPIndex; break;\n        case TIFFEncoding.JPEG:     index = compJPEGIndex; break;\n        default: index = compNoneIndex;    break;\n    }\n\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.ddCompression.items[index].selected = true;\n\n\tif (TIFFEncoding.JPEG != exportInfo.tiffCompression) { \/\/ if not JPEG\n\t\tdlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.stQuality.enabled = false;\n\t\tdlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.etQuality.enabled = false;\n    }\n\n\n\t\/\/ PDF options\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions = dlgMain.pnlFileType.pnlOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.orientation = &#39;column&#39;;\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.visible = (exportInfo.fileType == pdfIndex);\n\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression = dlgMain.pnlFileType.pnlOptions.grpPDFOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.alignment = &#39;left&#39;;\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.add(&quot;statictext&quot;, undefined, strLabelEncoding);\n\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.rbZip = dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.add(&quot;radiobutton&quot;, undefined, &quot;ZIP&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.rbZip.onClick = function() {\n\t\tdlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.stQuality.enabled = false;\n\t\tdlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.etQuality.enabled = false;\n\t}\n\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.rbJpeg = dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.add(&quot;radiobutton&quot;, undefined, &quot;JPEG&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.rbJpeg.onClick = function() {\n\t\tdlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.stQuality.enabled = true;\n\t\tdlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.etQuality.enabled = true;\n\t}\n\n\tdlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality = dlgMain.pnlFileType.pnlOptions.grpPDFOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.alignment = &#39;left&#39;;\n\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.stQuality = dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.add(&quot;statictext&quot;, undefined, strLabelQuality);\n\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.etQuality = dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.add(&quot;edittext&quot;, undefined, exportInfo.pdfJpegQuality.toString());\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.etQuality.preferredSize.width = StrToIntWithDefault( stretQuality, 30 );\n\tdlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.etQuality.graphics.disabledBackgroundColor = brush;\n\n    switch (exportInfo.pdfEncoding) {\n        case PDFEncoding.PDFZIP:\n\t\t\tdlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.rbZip.value  = true;    break;\n        case PDFEncoding.JPEG:\n        default:\n\t\t\tdlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.rbJpeg.value = true;    break;\n    }\n\n    if (PDFEncoding.JPEG != exportInfo.pdfEncoding) {\n        dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.stQuality.enabled = false;\n        dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.etQuality.enabled = false;\n    }\n\n\t\/\/ Targa options\n\tdlgMain.pnlFileType.pnlOptions.grpTargaOptions = dlgMain.pnlFileType.pnlOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpTargaOptions.add(&quot;statictext&quot;, undefined, strLabelDepth);\n    dlgMain.pnlFileType.pnlOptions.grpTargaOptions.visible = (exportInfo.fileType == targaIndex);\n\n    dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb16bit = dlgMain.pnlFileType.pnlOptions.grpTargaOptions.add( &quot;radiobutton&quot;, undefined, strRadiobutton16bit);\n    dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb24bit = dlgMain.pnlFileType.pnlOptions.grpTargaOptions.add( &quot;radiobutton&quot;, undefined, strRadiobutton24bit);\n    dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb32bit = dlgMain.pnlFileType.pnlOptions.grpTargaOptions.add( &quot;radiobutton&quot;, undefined, strRadiobutton32bit);\n\n    switch (exportInfo.targaDepth) {\n        case TargaBitsPerPixels.SIXTEEN:     dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb16bit.value = true;   break;\n        case TargaBitsPerPixels.TWENTYFOUR:  dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb24bit.value = true;   break;\n        case TargaBitsPerPixels.THIRTYTWO:   dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb32bit.value = true;   break;\n        default: dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb24bit.value = true;   break;\n    }\n\n\n\t\/\/ BMP options\n    dlgMain.pnlFileType.pnlOptions.grpBMPOptions = dlgMain.pnlFileType.pnlOptions.add(&quot;group&quot;);\n    dlgMain.pnlFileType.pnlOptions.grpBMPOptions.add(&quot;statictext&quot;, undefined, strLabelDepth);\n    dlgMain.pnlFileType.pnlOptions.grpBMPOptions.visible = (exportInfo.fileType == bmpIndex);\n\n    dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb16bit = dlgMain.pnlFileType.pnlOptions.grpBMPOptions.add( &quot;radiobutton&quot;, undefined, strRadiobutton16bit);\n    dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb24bit = dlgMain.pnlFileType.pnlOptions.grpBMPOptions.add( &quot;radiobutton&quot;, undefined, strRadiobutton24bit);\n    dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb32bit = dlgMain.pnlFileType.pnlOptions.grpBMPOptions.add( &quot;radiobutton&quot;, undefined, strRadiobutton32bit);\n\n    switch (exportInfo.bmpDepth) {\n        case BMPDepthType.SIXTEEN:   dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb16bit.value = true;   break;\n        case BMPDepthType.TWENTYFOUR:dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb24bit.value = true;   break;\n        case BMPDepthType.THIRTYTWO: dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb32bit.value = true;   break;\n        default: dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb24bit.value = true;   break;\n    }\n\n\t\/\/ the right side of the dialog, the ok and cancel buttons\n\tdlgMain.grpTopRight = dlgMain.grpTop.add(&quot;group&quot;);\n\tdlgMain.grpTopRight.orientation = &#39;column&#39;;\n\tdlgMain.grpTopRight.alignChildren = &#39;fill&#39;;\n\n\tdlgMain.btnRun = dlgMain.grpTopRight.add(&quot;button&quot;, undefined, strButtonRun );\n    dlgMain.btnRun.onClick = function() {\n\t\t\/\/ check if the setting is properly\n\t\tvar destination = dlgMain.etDestination.text;\n\t\tif (destination.length == 0) {\n\t        alert(strAlertSpecifyDestination);\n\t\t\treturn;\n\t\t}\n\t\tvar testFolder = new Folder(destination);\n\t\tif (!testFolder.exists) {\n\t        alert(strAlertDestinationNotExist);\n\t\t\treturn;\n\t\t}\n\n\t\tdlgMain.close(runButtonID);\n\t}\n\n\tdlgMain.btnCancel = dlgMain.grpTopRight.add(&quot;button&quot;, undefined, strButtonCancel );\n    dlgMain.btnCancel.onClick = function() {\n\t\tdlgMain.close(cancelButtonID);\n\t}\n\n\tdlgMain.defaultElement = dlgMain.btnRun;\n\tdlgMain.cancelElement = dlgMain.btnCancel;\n\n   \t\/\/ the bottom of the dialog\n\tdlgMain.grpBottom = dlgMain.add(&quot;group&quot;);\n\tdlgMain.grpBottom.orientation = &#39;column&#39;;\n\tdlgMain.grpBottom.alignChildren = &#39;left&#39;;\n\tdlgMain.grpBottom.alignment = &#39;fill&#39;;\n\n    dlgMain.pnlHelp = dlgMain.grpBottom.add(&quot;panel&quot;);\n    dlgMain.pnlHelp.alignment = &#39;fill&#39;;\n\n    dlgMain.etHelp = dlgMain.pnlHelp.add(&quot;statictext&quot;, undefined, strHelpText, {multiline:true});\n    dlgMain.etHelp.alignment = &#39;fill&#39;;\n\n\t\/\/ do not allow anything except for numbers 0-9\n\t\/\/dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.etQuality.addEventListener (&#39;keydown&#39;, NumericEditKeyboardHandler);\n\n\t\/\/ do not allow anything except for numbers 0-9\n\t\/\/dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.etQuality.addEventListener (&#39;keydown&#39;, NumericEditKeyboardHandler);\n\n\t\/\/ do not allow anything except for numbers 0-9\n\t\/\/dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.etQuality.addEventListener (&#39;keydown&#39;, NumericEditKeyboardHandler);\n\n\t dlgMain.onShow = function() {\n\t\t dlgMain.ddFileType.onChange();\n\t }\n\n    \/\/ in case we double clicked the file\n    app.bringToFront();\n\n    dlgMain.center();\n\n    var result = dlgMain.show();\n\n    if (cancelButtonID == result) {\n\t\treturn result;  \/\/ close to quit\n\t}\n\n    \/\/ get setting from dialog\n    exportInfo.destination = dlgMain.etDestination.text;\n    exportInfo.fileNamePrefix = dlgMain.etFileNamePrefix.text;\n    exportInfo.selectionOnly = dlgMain.cbSelection.value;\n    exportInfo.numericPrefix = dlgMain.cbNumericPrefix.value;\n    exportInfo.lowerCase = dlgMain.cbLowerCase.value;\n    exportInfo.fileType = dlgMain.ddFileType.selection.index;\n    exportInfo.icc = dlgMain.cbIcc.value;\n    exportInfo.jpegQuality = dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.etQuality.text;\n    exportInfo.psdMaxComp = dlgMain.pnlFileType.pnlOptions.grpPSDOptions.cbMax.value;\n    index = dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpCompression.ddCompression.selection.index;\n    if (index == compNoneIndex) {\n\t\texportInfo.tiffCompression = TIFFEncoding.NONE;\n\t}\n    if (index == compLZWIndex) {\n\t\texportInfo.tiffCompression = TIFFEncoding.TIFFLZW;\n\t}\n    if (index == compZIPIndex) {\n\t\texportInfo.tiffCompression = TIFFEncoding.TIFFZIP;\n\t}\n    if (index == compJPEGIndex) {\n\t\texportInfo.tiffCompression = TIFFEncoding.JPEG;\n\t}\n    exportInfo.tiffJpegQuality = dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.grpQuality.etQuality.text;\n    if (dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.rbZip.value) {\n\t\texportInfo.pdfEncoding = PDFEncoding.PDFZIP;\n\t}\n    if (dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpCompression.rbJpeg.value) {\n\t\texportInfo.pdfEncoding = PDFEncoding.JPEG;\n\t}\n    exportInfo.pdfJpegQuality = dlgMain.pnlFileType.pnlOptions.grpPDFOptions.grpQuality.etQuality.text;\n    if (dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb16bit.value) {\n\t\texportInfo.targaDepth = TargaBitsPerPixels.SIXTEEN;\n\t}\n    if (dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb24bit.value) {\n\t\texportInfo.targaDepth = TargaBitsPerPixels.TWENTYFOUR;\n\t}\n    if (dlgMain.pnlFileType.pnlOptions.grpTargaOptions.rb32bit.value) {\n\t\texportInfo.targaDepth = TargaBitsPerPixels.THIRTYTWO;\n\t}\n    if (dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb16bit.value) {\n\t\texportInfo.bmpDepth = BMPDepthType.SIXTEEN;\n\t}\n    if (dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb24bit.value) {\n\t\texportInfo.bmpDepth = BMPDepthType.TWENTYFOUR;\n\t}\n    if (dlgMain.pnlFileType.pnlOptions.grpBMPOptions.rb32bit.value) {\n\t\texportInfo.bmpDepth = BMPDepthType.THIRTYTWO;\n\t}\n\n    return result;\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: hideAllFileTypePanel\n\/\/ Usage: hide all the panels in the common actions\n\/\/ Input: &lt;none&gt;, dlgMain is a global for this script\n\/\/ Return: &lt;none&gt;, all panels are now hidden\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nfunction hideAllFileTypePanel() {\n\/*\n    dlgMain.pnlFileType.pnlOptions.grpPSDOptions.hide();\n    dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.hide();\n    dlgMain.pnlFileType.pnlOptions.grpTIFFOptions.hide();\n    dlgMain.pnlFileType.pnlOptions.grpPDFOptions.hide();\n    dlgMain.pnlFileType.pnlOptions.grpTargaOptions.hide();\n    dlgMain.pnlFileType.pnlOptions.grpBMPOptions.hide();\n    dlgMain.pnlFileType.pnlOptions.grpPNG8Options.hide();\n    dlgMain.pnlFileType.pnlOptions.grpPNG24Options.hide();\n*\/\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: initExportInfo\n\/\/ Usage: create our default parameters\n\/\/ Input: a new Object\n\/\/ Return: a new object with params set to default\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction initExportInfo(exportInfo)\n{\n    exportInfo.destination = new String(&quot;&quot;);\n    exportInfo.fileNamePrefix = new String(&quot;untitled_&quot;);\n    exportInfo.selectionOnly = false;\n    exportInfo.fileType = psdIndex;\n    exportInfo.icc = true;\n    exportInfo.jpegQuality = 8;\n    exportInfo.psdMaxComp = true;\n    exportInfo.tiffCompression = TIFFEncoding.NONE;\n    exportInfo.tiffJpegQuality = 8;\n    exportInfo.pdfEncoding = PDFEncoding.JPEG;\n    exportInfo.pdfJpegQuality = 8;\n    exportInfo.targaDepth = TargaBitsPerPixels.TWENTYFOUR;\n    exportInfo.bmpDepth = BMPDepthType.TWENTYFOUR;\n    exportInfo.png24Transparency = true;\n    exportInfo.png24Interlaced = false;\n    exportInfo.png8Transparency = true;\n    exportInfo.png8Interlaced = false;\n\n    try {\n        exportInfo.destination = Folder(app.activeDocument.fullName.parent).fsName; \/\/ destination folder\n        var tmp = app.activeDocument.fullName.name;\n        exportInfo.fileNamePrefix = decodeURI(tmp.substring(0, tmp.indexOf(&quot;.&quot;))); \/\/ filename body part\n    } catch(someError) {\n        exportInfo.destination = new String(&quot;&quot;);\n        exportInfo.fileNamePrefix = app.activeDocument.name; \/\/ filename body part\n    }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: saveFile\n\/\/ Usage: the worker routine, take our params and save the file accordingly\n\/\/ Input: reference to the document, the name of the output file,\n\/\/        export info object containing more information\n\/\/ Return: &lt;none&gt;, a file on disk\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction saveFile( docRef, fileNameBody, exportInfo)\n{\n\tif ( true \/* folderExists(exportInfo.destination)*\/) {\n\t\tswitch (exportInfo.fileType) {\n\t\t\tcase jpegIndex:\n\t\t\t\tdocRef.bitsPerChannel = BitsPerChannelType.EIGHT;\n\t\t\t\tvar saveFile = new File(exportInfo.destination + &quot;\/&quot; + fileNameBody + &quot;.jpg&quot;);\n\t\t\t\tjpgSaveOptions = new JPEGSaveOptions();\n\t\t\t\tjpgSaveOptions.embedColorProfile = exportInfo.icc;\n\t\t\t\tjpgSaveOptions.quality = exportInfo.jpegQuality;\n\t\t\t\tdocRef.saveAs(saveFile, jpgSaveOptions, true, Extension.LOWERCASE);\n\t\t\t\tbreak;\n\t\t\tcase psdIndex:\n\t\t\t\tvar saveFile = new File(exportInfo.destination + &quot;\/&quot; + fileNameBody + &quot;.psd&quot;);\n\t\t\t\tpsdSaveOptions = new PhotoshopSaveOptions();\n\t\t\t\tpsdSaveOptions.embedColorProfile = exportInfo.icc;\n\t\t\t\tdocRef.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE);\n\t\t\t\tbreak;\n\t\t\tcase tiffIndex:\n\t\t\t\tvar saveFile = new File(exportInfo.destination + &quot;\/&quot; + fileNameBody + &quot;.tif&quot;);\n\t\t\t\ttiffSaveOptions = new TiffSaveOptions();\n\t\t\t\ttiffSaveOptions.embedColorProfile = exportInfo.icc;\n\t\t\t\ttiffSaveOptions.imageCompression = exportInfo.tiffCompression;\n\t\t\t\tif (TIFFEncoding.JPEG == exportInfo.tiffCompression)    tiffSaveOptions.jpegQuality = exportInfo.tiffJpegQuality;\n\t\t\t\tdocRef.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE);\n\t\t\t\tbreak;\n\t\t\tcase pdfIndex:\n\t\t\t\tif (docRef.bitsPerChannel == BitsPerChannelType.THIRTYTWO)\n\t\t\t\t\tdocRef.bitsPerChannel = BitsPerChannelType.SIXTEEN;\n\t\t\t\tvar saveFile = new File(exportInfo.destination + &quot;\/&quot; + fileNameBody + &quot;.pdf&quot;);\n\t\t\t\tpdfSaveOptions = new PDFSaveOptions();\n\t\t\t\tpdfSaveOptions.embedColorProfile = exportInfo.icc;\n\t\t\t\tpdfSaveOptions.encoding = exportInfo.pdfEncoding;\n\t\t\t\tif (PDFEncoding.JPEG == exportInfo.pdfEncoding) pdfSaveOptions.jpegQuality = exportInfo.pdfJpegQuality;\n\t\t\t\tdocRef.saveAs(saveFile, pdfSaveOptions, true, Extension.LOWERCASE);\n\t\t\t\tbreak;\n\t\t\tcase targaIndex:\n\t\t\t\tdocRef.bitsPerChannel = BitsPerChannelType.EIGHT;\n\t\t\t\tvar saveFile = new File(exportInfo.destination + &quot;\/&quot; + fileNameBody + &quot;.tga&quot;);\n\t\t\t\ttargaSaveOptions = new TargaSaveOptions();\n\t\t\t\ttargaSaveOptions.resolution = exportInfo.targaDepth;\n\t\t\t\tdocRef.saveAs(saveFile, targaSaveOptions, true, Extension.LOWERCASE);\n\t\t\t\tbreak;\n\t\t\tcase bmpIndex:\n\t\t\t\tdocRef.bitsPerChannel = BitsPerChannelType.EIGHT;\n\t\t\t\tvar saveFile = new File(exportInfo.destination + &quot;\/&quot; + fileNameBody + &quot;.bmp&quot;);\n\t\t\t\tbmpSaveOptions = new BMPSaveOptions();\n\t\t\t\tbmpSaveOptions.depth = exportInfo.bmpDepth;\n\t\t\t\tdocRef.saveAs(saveFile, bmpSaveOptions, true, Extension.LOWERCASE);\n\t\t\t\tbreak;\n        case png8Index:\n\t\t\tsaveFile(docRef, fileNameBody, exportInfo, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trans.value);\n        \tfunction saveFile( docRef, fileNameBody, exportInfo, interlacedValue, transparencyValue) {\n\t\t\t\tvar id5 = charIDToTypeID( &quot;Expr&quot; );\n\t\t\t\t\tvar desc3 = new ActionDescriptor();\n\t\t\t\t\tvar id6 = charIDToTypeID( &quot;Usng&quot; );\n\t\t\t\t\t\tvar desc4 = new ActionDescriptor();\n\t\t\t\t\t\tvar id7 = charIDToTypeID( &quot;Op  &quot; );\n\t\t\t\t\t\tvar id8 = charIDToTypeID( &quot;SWOp&quot; );\n\t\t\t\t\t\tvar id9 = charIDToTypeID( &quot;OpSa&quot; );\n\t\t\t\t\t\tdesc4.putEnumerated( id7, id8, id9 );\n\t\t\t\t\t\tvar id10 = charIDToTypeID( &quot;Fmt &quot; );\n\t\t\t\t\t\tvar id11 = charIDToTypeID( &quot;IRFm&quot; );\n\t\t\t\t\t\tvar id12 = charIDToTypeID( &quot;PNG8&quot; );\n\t\t\t\t\t\tdesc4.putEnumerated( id10, id11, id12 );\n\t\t\t\t\t\tvar id13 = charIDToTypeID( &quot;Intr&quot; ); \/\/Interlaced\n\t\t\t\t\t\tdesc4.putBoolean( id13, interlacedValue );\n\t\t\t\t\t\tvar id14 = charIDToTypeID( &quot;RedA&quot; );\n\t\t\t\t\t\tvar id15 = charIDToTypeID( &quot;IRRd&quot; );\n\t\t\t\t\t\tvar id16 = charIDToTypeID( &quot;Prcp&quot; ); \/\/Algorithm\n\t\t\t\t\t\tdesc4.putEnumerated( id14, id15, id16 );\n\t\t\t\t\t\tvar id17 = charIDToTypeID( &quot;RChT&quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id17, false );\n\t\t\t\t\t\tvar id18 = charIDToTypeID( &quot;RChV&quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id18, false );\n\t\t\t\t\t\tvar id19 = charIDToTypeID( &quot;AuRd&quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id19, false );\n\t\t\t\t\t\tvar id20 = charIDToTypeID( &quot;NCol&quot; ); \/\/NO. Of Colors\n\t\t\t\t\t\tdesc4.putInteger( id20, 256 );\n\t\t\t\t\t\tvar id21 = charIDToTypeID( &quot;Dthr&quot; ); \/\/Dither\n\t\t\t\t\t\tvar id22 = charIDToTypeID( &quot;IRDt&quot; );\n\t\t\t\t\t\tvar id23 = charIDToTypeID( &quot;Dfsn&quot; ); \/\/Dither type\n\t\t\t\t\t\tdesc4.putEnumerated( id21, id22, id23 );\n\t\t\t\t\t\tvar id24 = charIDToTypeID( &quot;DthA&quot; );\n\t\t\t\t\t\tdesc4.putInteger( id24, 100 );\n\t\t\t\t\t\tvar id25 = charIDToTypeID( &quot;DChS&quot; );\n\t\t\t\t\t\tdesc4.putInteger( id25, 0 );\n\t\t\t\t\t\tvar id26 = charIDToTypeID( &quot;DCUI&quot; );\n\t\t\t\t\t\tdesc4.putInteger( id26, 0 );\n\t\t\t\t\t\tvar id27 = charIDToTypeID( &quot;DChT&quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id27, false );\n\t\t\t\t\t\tvar id28 = charIDToTypeID( &quot;DChV&quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id28, false );\n\t\t\t\t\t\tvar id29 = charIDToTypeID( &quot;WebS&quot; );\n\t\t\t\t\t\tdesc4.putInteger( id29, 0 );\n\t\t\t\t\t\tvar id30 = charIDToTypeID( &quot;TDth&quot; ); \/\/transparency dither\n\t\t\t\t\t\tvar id31 = charIDToTypeID( &quot;IRDt&quot; );\n\t\t\t\t\t\tvar id32 = charIDToTypeID( &quot;None&quot; );\n\t\t\t\t\t\tdesc4.putEnumerated( id30, id31, id32 );\n\t\t\t\t\t\tvar id33 = charIDToTypeID( &quot;TDtA&quot; );\n\t\t\t\t\t\tdesc4.putInteger( id33, 100 );\n\t\t\t\t\t\tvar id34 = charIDToTypeID( &quot;Trns&quot; ); \/\/Transparency\n\t\t\t\t\t\tdesc4.putBoolean( id34, transparencyValue );\n\t\t\t\t\t\tvar id35 = charIDToTypeID( &quot;Mtt &quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id35, true );\t\t \/\/matte\n\t\t\t\t\t\tvar id36 = charIDToTypeID( &quot;MttR&quot; ); \/\/matte color\n\t\t\t\t\t\tdesc4.putInteger( id36, 255 );\n\t\t\t\t\t\tvar id37 = charIDToTypeID( &quot;MttG&quot; );\n\t\t\t\t\t\tdesc4.putInteger( id37, 255 );\n\t\t\t\t\t\tvar id38 = charIDToTypeID( &quot;MttB&quot; );\n\t\t\t\t\t\tdesc4.putInteger( id38, 255 );\n\t\t\t\t\t\tvar id39 = charIDToTypeID( &quot;SHTM&quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id39, false );\n\t\t\t\t\t\tvar id40 = charIDToTypeID( &quot;SImg&quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id40, true );\n\t\t\t\t\t\tvar id41 = charIDToTypeID( &quot;SSSO&quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id41, false );\n\t\t\t\t\t\tvar id42 = charIDToTypeID( &quot;SSLt&quot; );\n\t\t\t\t\t\t\tvar list1 = new ActionList();\n\t\t\t\t\t\tdesc4.putList( id42, list1 );\n\t\t\t\t\t\tvar id43 = charIDToTypeID( &quot;DIDr&quot; );\n\t\t\t\t\t\tdesc4.putBoolean( id43, false );\n\t\t\t\t\t\tvar id44 = charIDToTypeID( &quot;In  &quot; );\n\t\t\t\t\t\tdesc4.putPath( id44, new File( exportInfo.destination + &quot;\/&quot; + fileNameBody + &quot;.png&quot;) );\n\t\t\t\t\tvar id45 = stringIDToTypeID( &quot;SaveForWeb&quot; );\n\t\t\t\t\tdesc3.putObject( id6, id45, desc4 );\n\t\t\t\texecuteAction( id5, desc3, DialogModes.NO );\n\t\t\t}\n            break;\n        case png24Index:\n        \tsaveFile(docRef, fileNameBody, exportInfo, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trans.value);\n        \tfunction saveFile( docRef, fileNameBody, exportInfo, interlacedValue, transparencyValue) {\n\t\t\tvar id6 = charIDToTypeID( &quot;Expr&quot; );\n\t\t\t\tvar desc3 = new ActionDescriptor();\n\t\t\t\tvar id7 = charIDToTypeID( &quot;Usng&quot; );\n\t\t\t\t\tvar desc4 = new ActionDescriptor();\n\t\t\t\t\tvar id8 = charIDToTypeID( &quot;Op  &quot; );\n\t\t\t\t\tvar id9 = charIDToTypeID( &quot;SWOp&quot; );\n\t\t\t\t\tvar id10 = charIDToTypeID( &quot;OpSa&quot; );\n\t\t\t        desc4.putEnumerated( id8, id9, id10 );\n\t\t\t\t\tvar id11 = charIDToTypeID( &quot;Fmt &quot; );\n\t\t\t\t\tvar id12 = charIDToTypeID( &quot;IRFm&quot; );\n\t\t\t\t\tvar id13 = charIDToTypeID( &quot;PN24&quot; );\n\t\t\t\t\tdesc4.putEnumerated( id11, id12, id13 );\n\t\t\t\t\tvar id14 = charIDToTypeID( &quot;Intr&quot; );\n\t\t\t\t\tdesc4.putBoolean( id14, interlacedValue );\n\t\t\t\t\tvar id15 = charIDToTypeID( &quot;Trns&quot; );\n\t\t\t\t\tdesc4.putBoolean( id15, transparencyValue );\n\t\t\t\t\tvar id16 = charIDToTypeID( &quot;Mtt &quot; );\n\t\t\t\t\tdesc4.putBoolean( id16, true );\n\t\t\t\t\tvar id17 = charIDToTypeID( &quot;MttR&quot; );\n\t\t\t\t\tdesc4.putInteger( id17, 255 );\n\t\t\t\t\tvar id18 = charIDToTypeID( &quot;MttG&quot; );\n\t\t\t\t\tdesc4.putInteger( id18, 255 );\n\t\t\t\t\tvar id19 = charIDToTypeID( &quot;MttB&quot; );\n\t\t\t\t\tdesc4.putInteger( id19, 255 );\n\t\t\t\t\tvar id20 = charIDToTypeID( &quot;SHTM&quot; );\n\t\t\t\t\tdesc4.putBoolean( id20, false );\n\t\t\t\t\tvar id21 = charIDToTypeID( &quot;SImg&quot; );\n\t\t\t\t\tdesc4.putBoolean( id21, true );\n\t\t\t\t\tvar id22 = charIDToTypeID( &quot;SSSO&quot; );\n\t\t\t\t\tdesc4.putBoolean( id22, false );\n\t\t\t\t\tvar id23 = charIDToTypeID( &quot;SSLt&quot; );\n\t\t\t\t\t\tvar list1 = new ActionList();\n\t\t\t\t\tdesc4.putList( id23, list1 );\n\t\t\t\t\tvar id24 = charIDToTypeID( &quot;DIDr&quot; );\n\t\t\t\t\tdesc4.putBoolean( id24, false );\n\t\t\t\t\tvar id25 = charIDToTypeID( &quot;In  &quot; );\n\t\t\t\t\tdesc4.putPath( id25, new File( exportInfo.destination + &quot;\/&quot; + fileNameBody + &quot;.png&quot;) );\n\t\t\t\tvar id26 = stringIDToTypeID( &quot;SaveForWeb&quot; );\n\t\t\t\tdesc3.putObject( id7, id26, desc4 );\n\t\t\texecuteAction( id6, desc3, DialogModes.NO );\n\t\t\t}\n\n            break;\n\t\t\tdefault:\n\t\t\t\tif ( DialogModes.NO != app.playbackDisplayDialogs ) {\n\t\t\t\t\talert(strUnexpectedError);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: zeroSuppress\n\/\/ Usage: return a string padded to digit(s)\n\/\/ Input: num to convert, digit count needed\n\/\/ Return: string padded to digit length\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction zeroSuppress (num, digit)\n{\n    var tmp = num.toString();\n    while (tmp.length &lt; digit) {\n\t\ttmp = &quot;0&quot; + tmp;\n\t}\n    return tmp;\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: objectToDescriptor\n\/\/ Usage: create an ActionDescriptor from a JavaScript Object\n\/\/ Input: JavaScript Object (o)\n\/\/        object unique string (s)\n\/\/        Pre process converter (f)\n\/\/ Return: ActionDescriptor\n\/\/ NOTE: Only boolean, string, number and UnitValue are supported, use a pre processor\n\/\/       to convert (f) other types to one of these forms.\n\/\/ REUSE: This routine is used in other scripts. Please update those if you\n\/\/        modify. I am not using include or eval statements as I want these\n\/\/        scripts self contained.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction objectToDescriptor (o, s, f) {\n\tif (undefined != f) {\n\t\to = f(o);\n\t}\n\tvar d = new ActionDescriptor;\n\tvar l = o.reflect.properties.length;\n\td.putString( app.charIDToTypeID( &#39;Msge&#39; ), s );\n\tfor (var i = 0; i &lt; l; i++ ) {\n\t\tvar k = o.reflect.properties[i].toString();\n\t\tif (k == &quot;__proto__&quot; || k == &quot;__count__&quot; || k == &quot;__class__&quot; || k == &quot;reflect&quot;)\n\t\t\tcontinue;\n\t\tvar v = o[ k ];\n\t\tk = app.stringIDToTypeID(k);\n\t\tswitch ( typeof(v) ) {\n\t\t\tcase &quot;boolean&quot;:\n\t\t\t\td.putBoolean(k, v);\n\t\t\t\tbreak;\n\t\t\tcase &quot;string&quot;:\n\t\t\t\td.putString(k, v);\n\t\t\t\tbreak;\n\t\t\tcase &quot;number&quot;:\n\t\t\t\td.putDouble(k, v);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t{\n\t\t\t\tif ( v instanceof UnitValue ) {\n\t\t\t\t\tvar uc = new Object;\n\t\t\t\t\tuc[&quot;px&quot;] = charIDToTypeID(&quot;#Rlt&quot;); \/\/ unitDistance\n\t\t\t\t\tuc[&quot;%&quot;] = charIDToTypeID(&quot;#Prc&quot;); \/\/ unitPercent\n\t\t\t\t\td.putUnitDouble(k, uc[v.type], v.value);\n\t\t\t\t} else {\n\t\t\t\t\tthrow( new Error(&quot;Unsupported type in objectToDescriptor &quot; + typeof(v) ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n    return d;\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: descriptorToObject\n\/\/ Usage: update a JavaScript Object from an ActionDescriptor\n\/\/ Input: JavaScript Object (o), current object to update (output)\n\/\/        Photoshop ActionDescriptor (d), descriptor to pull new params for object from\n\/\/        object unique string (s)\n\/\/        JavaScript Function (f), post process converter utility to convert\n\/\/ Return: Nothing, update is applied to passed in JavaScript Object (o)\n\/\/ NOTE: Only boolean, string, number and UnitValue are supported, use a post processor\n\/\/       to convert (f) other types to one of these forms.\n\/\/ REUSE: This routine is used in other scripts. Please update those if you\n\/\/        modify. I am not using include or eval statements as I want these\n\/\/        scripts self contained.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction descriptorToObject (o, d, s, f) {\n\tvar l = d.count;\n\tif (l) {\n\t    var keyMessage = app.charIDToTypeID( &#39;Msge&#39; );\n        if ( d.hasKey(keyMessage) && ( s != d.getString(keyMessage) )) return;\n\t}\n\tfor (var i = 0; i &lt; l; i++ ) {\n\t\tvar k = d.getKey(i); \/\/ i + 1 ?\n\t\tvar t = d.getType(k);\n\t\tstrk = app.typeIDToStringID(k);\n\t\tswitch (t) {\n\t\t\tcase DescValueType.BOOLEANTYPE:\n\t\t\t\to[strk] = d.getBoolean(k);\n\t\t\t\tbreak;\n\t\t\tcase DescValueType.STRINGTYPE:\n\t\t\t\to[strk] = d.getString(k);\n\t\t\t\tbreak;\n\t\t\tcase DescValueType.DOUBLETYPE:\n\t\t\t\to[strk] = d.getDouble(k);\n\t\t\t\tbreak;\n\t\t\tcase DescValueType.UNITDOUBLE:\n\t\t\t\t{\n\t\t\t\tvar uc = new Object;\n\t\t\t\tuc[charIDToTypeID(&quot;#Rlt&quot;)] = &quot;px&quot;; \/\/ unitDistance\n\t\t\t\tuc[charIDToTypeID(&quot;#Prc&quot;)] = &quot;%&quot;; \/\/ unitPercent\n\t\t\t\tuc[charIDToTypeID(&quot;#Pxl&quot;)] = &quot;px&quot;; \/\/ unitPixels\n\t\t\t\tvar ut = d.getUnitDoubleType(k);\n\t\t\t\tvar uv = d.getUnitDoubleValue(k);\n\t\t\t\to[strk] = new UnitValue( uv, uc[ut] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase DescValueType.INTEGERTYPE:\n\t\t\tcase DescValueType.ALIASTYPE:\n\t\t\tcase DescValueType.CLASSTYPE:\n\t\t\tcase DescValueType.ENUMERATEDTYPE:\n\t\t\tcase DescValueType.LISTTYPE:\n\t\t\tcase DescValueType.OBJECTTYPE:\n\t\t\tcase DescValueType.RAWTYPE:\n\t\t\tcase DescValueType.REFERENCETYPE:\n\t\t\tdefault:\n\t\t\t\tthrow( new Error(&quot;Unsupported type in descriptorToObject &quot; + t ) );\n\t\t}\n\t}\n\tif (undefined != f) {\n\t\to = f(o);\n\t}\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: preProcessExportInfo\n\/\/ Usage: convert Photoshop enums to strings for storage\n\/\/ Input: JavaScript Object of my params for this script\n\/\/ Return: JavaScript Object with objects converted for storage\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction preProcessExportInfo(o) {\n\to.tiffCompression = o.tiffCompression.toString();\n\to.pdfEncoding = o.pdfEncoding.toString();\n\to.targaDepth = o.targaDepth.toString();\n\to.bmpDepth = o.bmpDepth.toString();\n\treturn o;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: postProcessExportInfo\n\/\/ Usage: convert strings from storage to Photoshop enums\n\/\/ Input: JavaScript Object of my params in string form\n\/\/ Return: JavaScript Object with objects in enum form\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction postProcessExportInfo(o) {\n\to.tiffCompression = eval(o.tiffCompression);\n\to.pdfEncoding = eval(o.pdfEncoding);\n\to.targaDepth = eval(o.targaDepth);\n\to.bmpDepth = eval(o.bmpDepth);\n\treturn o;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: StrToIntWithDefault\n\/\/ Usage: convert a string to a number, first stripping all characters\n\/\/ Input: string and a default number\n\/\/ Return: a number\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction StrToIntWithDefault( s, n ) {\n    var onlyNumbers = \/[^0-9]\/g;\n    var t = s.replace( onlyNumbers, &quot;&quot; );\n\tt = parseInt( t );\n\tif ( ! isNaN( t ) ) {\n        n = t;\n    }\n    return n;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: folderExists\n\/\/ Usage: see if the string passed in is a valid folder ask to create if not\n\/\/ Input: string of the folder in question\n\/\/ Return: true if folder exists or was created successfully\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction folderExists( folderAsString ) {\n\tvar f = Folder(folderAsString);\n\tif (f.exists) return true;\n\tif (DialogModes.NO == app.playbackDisplayDialogs) return false;\n\tif (confirm(strCreateFolder + folderAsString)) {\n\t\tif (f.create()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(strCouldNotCreate);\n\t\t}\n\t}\n\treturn false;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Function: NumericEditKeyboardHandler\n\/\/ Usage: Do not allow anything except for numbers 0-9\n\/\/ Input: ScriptUI keydown event\n\/\/ Return: &lt;nothing&gt; key is rejected and beep is sounded if invalid\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction NumericEditKeyboardHandler (event) {\n    try {\n        var keyIsOK = KeyIsNumeric (event) ||\n\t\t              KeyIsDelete (event) ||\n\t\t\t\t\t  KeyIsLRArrow (event) ||\n\t\t\t\t\t  KeyIsTabEnterEscape (event);\n\n        if (! keyIsOK) {\n            \/\/    Bad input: tell ScriptUI not to accept the keydown event\n            event.preventDefault();\n            \/*    Notify user of invalid input: make sure NOT\n                to put up an alert dialog or do anything which\n                requires user interaction, because that\n                interferes with preventing the &#39;default&#39;\n                action for the keydown event *\/\n            app.beep();\n        }\n    }\n    catch (e) {\n        ; \/\/ alert (&quot;Ack! bug in NumericEditKeyboardHandler: &quot; + e);\n    }\n}\n\n\n\/\/    key identifier functions\nfunction KeyHasModifier (event) {\n    return event.shiftKey || event.ctrlKey || event.altKey || event.metaKey;\n}\n\nfunction KeyIsNumeric (event) {\n    return  (event.keyName &gt;= &#39;0&#39;) && (event.keyName &lt;= &#39;9&#39;) && ! KeyHasModifier (event);\n}\n\nfunction KeyIsDelete (event) {\n    \/\/    Shift-delete is ok\n    return ((event.keyName == &#39;Backspace&#39;) || (event.keyName == &#39;Delete&#39;)) && ! (event.ctrlKey);\n}\n\nfunction KeyIsLRArrow (event) {\n    return ((event.keyName == &#39;Left&#39;) || (event.keyName == &#39;Right&#39;)) && ! (event.altKey || event.metaKey);\n}\n\nfunction KeyIsTabEnterEscape (event) {\n\treturn event.keyName == &#39;Tab&#39; || event.keyName == &#39;Enter&#39; || event.keyName == &#39;Escape&#39;;\n}\n\n\/\/ End Layer Comps To Files.jsx<\/code><\/pre><\/div>\n\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u65e7\u6a19\u6e96\u8a18\u4e8b\u306e\u547d\u540d\u90e8\u5206\uff08\u8aac\u660e\u7528\u65ad\u7247\uff09<\/summary>\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>fileNameBody = fileNameBody.join(&#39;_&#39;).replace(\/[:\\\/\\\\*?&quot;&lt;&gt;|\\r\\n]\/g, &quot;_&quot;);<\/code><\/pre><\/div>\n\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u65e7\u30ab\u30b9\u30bf\u30e0\u8a18\u4e8b\u306ePNG\u4fdd\u5b58\u4f8b\uff08\u7701\u7565\u3042\u308a\uff09<\/summary>\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>#target photoshop\n$.localize = true;\n\n\/\/ UI\u30c6\u30ad\u30b9\u30c8\nvar strTitle = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Title=\u30ec\u30a4\u30e4\u30fc\u30b3\u30f3\u30d7\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58&quot;);\nvar strButtonRun = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Run=\u5b9f\u884c&quot;);\nvar strButtonCancel = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Cancel=\u30ad\u30e3\u30f3\u30bb\u30eb&quot;);\nvar strHelpText = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Help=\u5404\u30ec\u30a4\u30e4\u30fc\u30b3\u30f3\u30d7\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3059\u308b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3068\u5834\u6240\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;);\nvar strLabelDestination = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Destination=\u4fdd\u5b58\u5148:&quot;);\nvar strButtonBrowse = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Browse=\u53c2\u7167...&quot;);\nvar strLabelFileNamePrefix = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/FileNamePrefix=\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u63a5\u982d\u8f9e:&quot;);\n\n\/\/ \u30e1\u30a4\u30f3\u51e6\u7406\nmain();\n\nfunction main() {\n    if (app.documents.length &lt;= 0) {\n        alert(&quot;\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u958b\u304b\u308c\u3066\u3044\u307e\u305b\u3093\u3002&quot;);\n        return &#39;cancel&#39;;\n    }\n\n    var exportInfo = new Object();\n    initExportInfo(exportInfo);\n    \n    if (DialogModes.ALL == app.playbackDisplayDialogs) {\n        if (cancelButtonID == settingDialog(exportInfo)) {\n            return &#39;cancel&#39;;\n        }\n    }\n\n    try {\n        var docRef = app.activeDocument;\n        var compsCount = docRef.layerComps.length;\n        if (compsCount &lt; 1) {\n            alert(&quot;\u30ec\u30a4\u30e4\u30fc\u30b3\u30f3\u30d7\u304c\u3042\u308a\u307e\u305b\u3093\u3002&quot;);\n            return &#39;cancel&#39;;\n        }\n\n        for (var i = 0; i &lt; compsCount; i++) {\n            var compRef = docRef.layerComps[i];\n            if (exportInfo.selectionOnly && !compRef.selected) continue;\n            compRef.apply();\n            var duppedDocument = docRef.duplicate();\n            var fileName = generateFileName(compRef, exportInfo, i);\n            saveFile(duppedDocument, fileName, exportInfo);\n            duppedDocument.close(SaveOptions.DONOTSAVECHANGES);\n        }\n\n        alert(&quot;\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002&quot;);\n    } catch (e) {\n        alert(&quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f: &quot; + e);\n        return &#39;cancel&#39;;\n    }\n}\n\nfunction initExportInfo(exportInfo) {\n    exportInfo.destination = &quot;&quot;;\n    exportInfo.fileNamePrefix = &quot;layercomp&quot;;\n    exportInfo.selectionOnly = false;\n    exportInfo.fileType = &quot;png&quot;;\n}\n\nfunction generateFileName(compRef, exportInfo, index) {\n    var fileName = [];\n    if (exportInfo.fileNamePrefix) fileName.push(exportInfo.fileNamePrefix);\n    fileName.push(index.toString().padStart(4, &#39;0&#39;));\n    fileName.push(compRef.name);\n    return fileName.join(&#39;_&#39;).replace(\/[:\/\\\\*?&quot;&lt;&gt;|\\r\\n]\/g, &quot;_&quot;);\n}\n\nfunction saveFile(docRef, fileName, exportInfo) {\n    var savePath = new File(exportInfo.destination + &quot;\/&quot; + fileName + &quot;.png&quot;);\n    var pngSaveOptions = new PNGSaveOptions();\n    pngSaveOptions.interlaced = false;\n    docRef.saveAs(savePath, pngSaveOptions, true, Extension.LOWERCASE);\n}\n<\/code><\/pre><\/div>\n\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u65e7\u30ab\u30b9\u30bf\u30e0\u8a18\u4e8b\u306ePSD\u4fdd\u5b58\u4f8b\uff08\u4fdd\u5b58\u5148\u672a\u8a2d\u5b9a\uff09<\/summary>\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>$.localize = true;\n\n\/\/=================================================================\n\/\/ \u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\n\/\/=================================================================\n\n\/\/ \u30ed\u30fc\u30ab\u30e9\u30a4\u30ba\u3055\u308c\u305fUI\u6587\u5b57\u5217\nvar strTitle = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Title=\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u3092\u30d5\u30a1\u30a4\u30eb\u3078&quot;);\nvar strButtonRun = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Run=\u5b9f\u884c&quot;);\nvar strButtonCancel = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Cancel=\u30ad\u30e3\u30f3\u30bb\u30eb&quot;);\nvar strHelpText = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Help=\u5404\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u3092\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3068\u5834\u6240\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;);\nvar strLabelDestination = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Destination=\u4fdd\u5b58\u5148:&quot;);\nvar strButtonBrowse = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Browse=&\u53c2\u7167...&quot;);\nvar strLabelFileNamePrefix = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/FileNamePrefix=\u30d5\u30a1\u30a4\u30eb\u540d\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9:&quot;);\nvar strCheckboxSelectionOnly = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/SelectedOnly=&\u9078\u629e\u3057\u305f\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u306e\u307f&quot;);\nvar strCheckboxNumericPrefix = &#39;\u6570\u5024\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u8ffd\u52a0&#39;;\nvar strCheckboxLowerCase = &#39;\u5c0f\u6587\u5b57\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u4fdd\u5b58&#39;;\nvar strLabelFileType = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/FileType=\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f:&quot;);\nvar strCheckboxIncludeICCProfile = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/IncludeICC=&ICC\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092\u542b\u3080&quot;);\nvar strJPEGOptions = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/JPEGOptions=JPEG\u30aa\u30d7\u30b7\u30e7\u30f3:&quot;);\nvar strLabelQuality = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Quality=\u54c1\u8cea:&quot;);\nvar strPSDOptions = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/PSDOptions=PSD\u30aa\u30d7\u30b7\u30e7\u30f3:&quot;);\nvar strCheckboxMaximizeCompatibility = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Maximize=&\u4e92\u63db\u6027\u3092\u6700\u5927\u5316&quot;);\nvar strTIFFOptions = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/TIFFOptions=TIFF\u30aa\u30d7\u30b7\u30e7\u30f3:&quot;);\nvar strLabelImageCompression = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/ImageCompression=\u753b\u50cf\u5727\u7e2e:&quot;);\nvar strNone = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/None=\u306a\u3057&quot;);\nvar strAlertSpecifyDestination = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/SpecifyDestination=\u4fdd\u5b58\u5148\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;);\nvar strAlertNoLayerCompsFound = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/NoComps=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\uff01&quot;);\nvar strAlertWasSuccessful = localize(&quot;$$$\/JavaScripts\/LayerCompsToFiles\/Success= \u304c\u6210\u529f\u3057\u307e\u3057\u305f\u3002&quot;);\n\n\/\/ \u30e1\u30a4\u30f3\u95a2\u6570\u306e\u5b9f\u884c\nmain();\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ \u30e1\u30a4\u30f3\u51e6\u7406\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction main() {\n    if (app.documents.length &lt;= 0) {\n        alert(strAlertNoLayerCompsFound);\n        return &#39;cancel&#39;;\n    }\n\n    var exportInfo = {};\n    initExportInfo(exportInfo);\n\n    \/\/ \u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u306e\u53d6\u5f97\n    var docRef = app.activeDocument;\n    var compsCount = docRef.layerComps.length;\n    if (compsCount &lt; 1) {\n        alert(strAlertNoLayerCompsFound);\n        return &#39;cancel&#39;;\n    }\n\n    for (var compsIndex = 0; compsIndex &lt; compsCount; compsIndex++) {\n        var compRef = docRef.layerComps[compsIndex];\n        if (exportInfo.selectionOnly && !compRef.selected) continue;\n        compRef.apply();\n        var duppedDocument = app.activeDocument.duplicate();\n\n        \/\/ \u30d5\u30a1\u30a4\u30eb\u540d\u306e\u751f\u6210\n        var fileNameBody = exportInfo.fileNamePrefix + &quot;_&quot; + zeroSuppress(compsIndex, 4) + &quot;_&quot; + compRef.name;\n        fileNameBody = fileNameBody.replace(\/[:\/\\\\*?&quot;&lt;&gt;|\\r\\n]\/g, &quot;_&quot;);\n        if (exportInfo.lowerCase) fileNameBody = fileNameBody.toLowerCase();\n\n        saveFile(duppedDocument, fileNameBody, exportInfo);\n        duppedDocument.close(SaveOptions.DONOTSAVECHANGES);\n    }\n    alert(strTitle + strAlertWasSuccessful);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u51e6\u7406\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction saveFile(docRef, fileNameBody, exportInfo) {\n    var saveFile = new File(exportInfo.destination + &quot;\/&quot; + fileNameBody + &quot;.psd&quot;);\n    var psdSaveOptions = new PhotoshopSaveOptions();\n    psdSaveOptions.embedColorProfile = exportInfo.icc;\n    docRef.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ \u30bc\u30ed\u57cb\u3081\u95a2\u6570\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction zeroSuppress(num, digit) {\n    var tmp = num.toString();\n    while (tmp.length &lt; digit) {\n        tmp = &quot;0&quot; + tmp;\n    }\n    return tmp;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ \u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u60c5\u5831\u306e\u521d\u671f\u5316\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction initExportInfo(exportInfo) {\n    exportInfo.destination = &quot;&quot;;\n    exportInfo.fileNamePrefix = &quot;layerComp&quot;;\n    exportInfo.selectionOnly = false;\n    exportInfo.lowerCase = false;\n    exportInfo.icc = true;\n}\n<\/code><\/pre><\/div>\n\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u65e7\u30ab\u30b9\u30bf\u30e0\u8a18\u4e8b\u306e\u533a\u5207\u308a\u5909\u66f4\u4f8b\uff08\u8aac\u660e\u7528\u65ad\u7247\uff09<\/summary>\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>fileNameBody = fileNameBody.join(&#39;_&#39;).replace(\/[:\\\/\\*\\?\\&quot;&lt;&gt;|\\r\\n]\/g, &quot;_&quot;);<\/code><\/pre><\/div>\n\n<\/details>\n","protected":false},"excerpt":{"rendered":"<p>\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u306e\u66f8\u304d\u51fa\u3057\u3067\u3001\u9023\u756a\u306e\u6709\u7121\u3084\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u533a\u5207\u308a\u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30ab\u30b9\u30bf\u30e0JSX\u3092\u691c\u8a0e\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u914d\u5e03\u5143\u306e\u30b3\u30fc\u30c9\u3068\u65e7\u63b2\u8f09\u7248\u3092\u533a\u5225\u3057\u3001\u5909\u66f4\u3059\u308b\u7b87\u6240\u3068\u78ba\u8a8d\u9805\u76ee\u3092\u6574\u7406\u3057\u307e\u3059\u3002 \u30ab\u30f3\u30d7\u306e\u4f5c\u6210\u3084\u6a19\u6e96\u306e\u66f8\u304d\u51fa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":314,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","ssp_meta_description":"\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u66f8\u304d\u51fa\u3057\u306e\u9023\u756a\u30fb\u547d\u540d\u898f\u5247\u3092\u5909\u66f4\u3059\u308bJSX\u306e\u78ba\u8a8d\u65b9\u6cd5\u3002\u5b8c\u5168\u7248\u3068\u7701\u7565\u4f8b\u3001\u540c\u540d\u306e\u885d\u7a81\u3001\u65e7\u63b2\u8f09\u30b3\u30fc\u30c9\u3068\u7121\u4eba\u5b9f\u884c\u306e\u9055\u3044\u3092\u6574\u7406\u3057\u307e\u3059\u3002","ssp_meta_title":"Photoshop\u306e\u30ec\u30a4\u30e4\u30fc\u30ab\u30f3\u30d7\u66f8\u304d\u51fa\u3057\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\uff5c\u9023\u756a\u30fb\u547d\u540d\u3068JSX\u306e\u78ba\u8a8d","ssp_meta_robots":"","ssp_meta_canonical":"","ssp_meta_image":"","ssp_meta_keyword":"","book_review_data":"","footnotes":""},"categories":[10],"tags":[9],"class_list":["post-312","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-import-export","tag-free"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/312","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=312"}],"version-history":[{"count":8,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/312\/revisions"}],"predecessor-version":[{"id":1414,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/312\/revisions\/1414"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media\/314"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media?parent=312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/categories?post=312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/tags?post=312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}