{"id":126,"date":"2015-07-14T01:03:53","date_gmt":"2015-07-13T16:03:53","guid":{"rendered":"http:\/\/ati.art.coocan.jp\/blog\/?p=126"},"modified":"2015-07-14T01:03:53","modified_gmt":"2015-07-13T16:03:53","slug":"photoshopscript%e3%81%ae%e8%ba%93%e3%81%84%e3%81%9f%e6%89%80","status":"publish","type":"post","link":"http:\/\/ati.art.coocan.jp\/blog\/?p=126","title":{"rendered":"PhotoshopScript\u306e\u8e93\u3044\u305f\u6240"},"content":{"rendered":"<p>\u81ea\u8eab\u304c\u8e93\u3044\u305f\u90e8\u5206\u3068\u3001\u89e3\u6c7a\u30b5\u30f3\u30d7\u30eb\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#i\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u8907\u88fd\u3067\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u540d\u3092\u6307\u5b9a\u3057\u305f\u3044<\/a><\/li><li><a href=\"#i-2\">\u30ec\u30a4\u30e4\u30fc\u306e\u8907\u88fd\u3067\u3001\u5225\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u8907\u88fd\u3057\u305f\u3044<\/a><\/li><li><a href=\"#WEB\">WEB\u7528\u306b\u4fdd\u5b58\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059<\/a><\/li><li><a href=\"#i-3\">\u9078\u629e\u30ec\u30a4\u30e4\u30fc\u3092\u30b9\u30de\u30fc\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5316<\/a><\/li><li><a href=\"#i-4\">\u9078\u629e\u30ec\u30a4\u30e4\u30fc\u3092\u30e9\u30b9\u30bf\u30e9\u30a4\u30ba<\/a><\/li><li><a href=\"#layers\">.layers\u306e\u4e2d\u306b\u306f\u30ec\u30a4\u30e4\u30fc\u3068\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u304c\u4e21\u65b9\u5165\u3063\u3066\u3044\u308b<\/a><\/li><li><a href=\"#PhotoshopObject_key_in\">Photoshop\u3067\u7528\u610f\u3055\u308c\u3066\u3044\u308bObject\u306b key in \u3059\u308b\u3068\u30a8\u30e9\u30fc\u3067\u6b62\u307e\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u3042\u308b<\/a><\/li><li><a href=\"#PhotoshopPathUserName\">Photoshop\u4e0a\u3067\u306ePath\u306f\u3001UserName\u304c\u5165\u3089\u306a\u3044<\/a><\/li><li><a href=\"#i-5\">\u30ab\u30e9\u30fc\u30e2\u30fc\u30c9\u306e\u53d6\u5f97\u3068\u5909\u66f4\u3067\u3001\u5b9a\u6570\u304c\u9055\u3046<\/a><\/li><\/ul><\/div>\n<h2><span id=\"i\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u8907\u88fd\u3067\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u540d\u3092\u6307\u5b9a\u3057\u305f\u3044<\/span><\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">activeDocument.duplicate('temp');\/\/\u8907\u88fd<\/pre>\n<p>\u5f15\u6570\u306bString\u3092\u5165\u308c\u308b\u3068\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u540d\u306b\u306a\u308b\u307f\u305f\u3044\u3002<\/p>\n<h2><span id=\"i-2\">\u30ec\u30a4\u30e4\u30fc\u306e\u8907\u88fd\u3067\u3001\u5225\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u8907\u88fd\u3057\u305f\u3044<\/span><\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">activeDocument.activeLayer.duplicate( documentHogehoge ); \/\/\u5f15\u6570\u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u5165\u308c\u308b\u3068\u305d\u3053\u306b\u8907\u88fd\u3055\u308c\u308b\nactiveDocument.activeLayer.duplicate( documentHogehoge.layerSets[0] ); \/\/\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u3092\u5165\u308c\u308b\u3068\u305d\u306e\u4e2d\u306b\u5165\u308b<\/pre>\n<p>\u5f15\u6570\u306b\u89aa\u306b\u306a\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3084\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u3092\u5165\u308c\u308b\u3068\u3044\u3044\u307f\u305f\u3044\u3002<\/p>\n<h2><span id=\"WEB\">WEB\u7528\u306b\u4fdd\u5b58\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059<\/span><\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">var idExpr = charIDToTypeID( &quot;Expr&quot; );\nvar desc15 = new ActionDescriptor();\n    var idUsng = charIDToTypeID( &quot;Usng&quot; );\n    var idSaveForWeb = stringIDToTypeID( &quot;SaveForWeb&quot; );\n    var desc16 = new ActionDescriptor();\n    desc15.putObject( idUsng, idSaveForWeb, desc16 );\nexecuteAction( idExpr, desc15, DialogModes.ALL \/*DialogModes.NO*\/ );<\/pre>\n<p>script Listener\u304b\u3089\u3002\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059\u3060\u3051\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u3084\u4fdd\u5b58\u5148\u306f\u76f4\u524d\u306b&#8221;WEB\u7528\u306b\u4fdd\u5b58&#8221;\u3057\u305f\u3082\u306e\u3092\u5f15\u304d\u7d99\u3050\u3002<\/p>\n<h2><span id=\"i-3\">\u9078\u629e\u30ec\u30a4\u30e4\u30fc\u3092\u30b9\u30de\u30fc\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5316<\/span><\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">executeAction(\n    stringIDToTypeID( &quot;newPlacedLayer&quot; ),\n    undefined,\n    DialogModes.NO\n);<\/pre>\n<p>script Listener\u304b\u3089\u3002activeDocument.activeLayer\u306b\u6709\u52b9<\/p>\n<h2><span id=\"i-4\">\u9078\u629e\u30ec\u30a4\u30e4\u30fc\u3092\u30e9\u30b9\u30bf\u30e9\u30a4\u30ba<\/span><\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">var desc5 = new ActionDescriptor();\nvar ref4 = new ActionReference();\nref4.putEnumerated(\n    charIDToTypeID( &quot;Lyr &quot; ),\n    charIDToTypeID( &quot;Ordn&quot; ),\n    charIDToTypeID( &quot;Trgt&quot; )\n);\ndesc5.putReference(\n    charIDToTypeID( &quot;null&quot; ),\n    ref4\n);\ndesc5.putEnumerated(\n    charIDToTypeID( &quot;What&quot; ),\n    stringIDToTypeID( &quot;rasterizeItem&quot; ),\n    stringIDToTypeID( &quot;layerStyle&quot; )\n);<\/pre>\n<p>script Listener\u304b\u3089\u3002activeDocument.activeLayer\u306b\u6709\u52b9<\/p>\n<h2><span id=\"layers\">.layers\u306e\u4e2d\u306b\u306f\u30ec\u30a4\u30e4\u30fc\u3068\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u304c\u4e21\u65b9\u5165\u3063\u3066\u3044\u308b<\/span><\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">activeDocument.layserSets; \/\/\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u306e\u307f\nactiveDocument.layers; \/\/\u30ec\u30a4\u30e4\u30fc\u3068\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8<\/pre>\n<p>\u62bd\u51fa\u6642\u306b\u6ce8\u610f\u3059\u308b\u5fc5\u8981\u30a2\u30ea\u3002<\/p>\n<h2><span id=\"PhotoshopObject_key_in\">Photoshop\u3067\u7528\u610f\u3055\u308c\u3066\u3044\u308bObject\u306b key in \u3059\u308b\u3068\u30a8\u30e9\u30fc\u3067\u6b62\u307e\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u3042\u308b<\/span><\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">for (var vLp in activeDocument){\n    activeDocument[vLp]; \/\/ &lt;- error\n}<\/pre>\n<p>try{}chatch(e){}\u3068\u304b\u3067\u56de\u907f\u3059\u308b\u3068\u3088\u3055\u3052\u3002<\/p>\n<h2><span id=\"PhotoshopPathUserName\">Photoshop\u4e0a\u3067\u306ePath\u306f\u3001UserName\u304c\u5165\u3089\u306a\u3044<\/span><\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">activeDocument.path; \/\/&quot;~\/Desktop&quot; \u306a\u3069\n(new File(activeDocument.path)).fsName; \u00a0 \u00a0 \/\/ &quot;~\/Desktop&quot; \u304b\u3089\u3001&quot;C:\\Users\\(User\u540d)\\Desktop&quot; \u7b49\u306e\u7d76\u5bfe\u30d1\u30b9\u306b\u76f4\u305b\u308b<\/pre>\n<p>photoshop\u5b8c\u7d50\u3060\u3063\u305f\u3089\u554f\u984c\u306a\u3044\u304c\u3001bat\u30d5\u30a1\u30a4\u30eb\u306b\u98db\u3070\u3057\u305f\u308a\u3059\u308b\u6642\u3053\u307e\u308b\u3002<\/p>\n<h2><span id=\"i-5\">\u30ab\u30e9\u30fc\u30e2\u30fc\u30c9\u306e\u53d6\u5f97\u3068\u5909\u66f4\u3067\u3001\u5b9a\u6570\u304c\u9055\u3046<\/span><\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\/\/\u6bd4\u8f03\u3059\u308b\u6642\u306fDocumentMode\u3092\u4f7f\u3046\nif(activeDocument.mode == DocumentMode.INDEXEDCOLOR){\n    activeDocument.changeMode(ChangeMode.RGB);\/\/\u5909\u66f4\u3059\u308b\u6642\u306fChangeMode\u3092\u4f7f\u3046\n}<\/pre>\n<p>\u3069\u3063\u3061\u304b\u306b\u3057\u3066\u307b\u3057\u3044\u305c\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u81ea\u8eab\u304c\u8e93\u3044\u305f\u90e8\u5206\u3068\u3001\u89e3\u6c7a\u30b5\u30f3\u30d7\u30eb\u3002 \u76ee\u6b21\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u8907\u88fd\u3067\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u540d\u3092\u6307\u5b9a\u3057\u305f\u3044\u30ec\u30a4\u30e4\u30fc\u306e\u8907\u88fd\u3067\u3001\u5225\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u8907\u88fd\u3057\u305f\u3044WEB\u7528\u306b\u4fdd\u5b58\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059\u9078\u629e\u30ec\u30a4\u30e4\u30fc\u3092\u30b9\u30de\u30fc\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5316\u9078\u629e\u30ec\u30a4\u30e4\u30fc\u3092\u30e9\u30b9\u30bf\u30e9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[16,19],"_links":{"self":[{"href":"http:\/\/ati.art.coocan.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/126"}],"collection":[{"href":"http:\/\/ati.art.coocan.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ati.art.coocan.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ati.art.coocan.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ati.art.coocan.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=126"}],"version-history":[{"count":0,"href":"http:\/\/ati.art.coocan.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/126\/revisions"}],"wp:attachment":[{"href":"http:\/\/ati.art.coocan.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ati.art.coocan.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ati.art.coocan.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}