{"id":182,"date":"2025-03-18T20:12:37","date_gmt":"2025-03-18T11:12:37","guid":{"rendered":"https:\/\/cg-method.com\/photoshop\/?p=182"},"modified":"2025-03-19T10:30:43","modified_gmt":"2025-03-19T01:30:43","slug":"create-custom-document","status":"publish","type":"post","link":"https:\/\/cg-method.com\/photoshop\/create-custom-document\/","title":{"rendered":"Photoshop\u30b9\u30af\u30ea\u30d7\u30c8\uff08jsx\uff09\u2502\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u300c\u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\u300d\u306b\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>Photoshop\u3067 <strong>\u65b0\u898f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3068\u540c\u6642\u306b\u3001\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\u306b\u5909\u66f4<\/strong> \u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001 <strong>\u30ef\u30f3\u30af\u30ea\u30c3\u30af\u3067\u6307\u5b9a\u30b5\u30a4\u30ba\u306e\u80cc\u666f\u3092\u4f5c\u6210<\/strong> \u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u6982\u8981<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30cf\u30fc\u30d5HD\u30b5\u30a4\u30ba\uff081280\u00d7720\uff09\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u4f5c\u6210<\/strong><\/li>\n\n\n\n<li><strong>\u80cc\u666f\u3092\u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\uff08\u30b0\u30ea\u30fc\u30f3\uff09\u306b\u8a2d\u5b9a<\/strong><\/li>\n\n\n\n<li><strong>\u30de\u30b9\u30af\u3092\u524a\u9664\u3057\u3001\u521d\u671f\u306e\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u524a\u9664<\/strong><\/li>\n\n\n\n<li><strong>\u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\u3092\u300c\u80cc\u666f\u300d\u306b\u30ea\u30cd\u30fc\u30e0<\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u300c\u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\u300d\u306b\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">STEP.1 \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u683c\u7d0d<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>createCustomDocument.jsx<\/code> \u3068\u3044\u3046\u540d\u524d\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4fdd\u5b58\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>createCustomDocument.jsx<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>createDocument(1280,720); \/\/ \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u65b0\u898f\u4f5c\u6210\nmakeSolidFill(0,255,0);   \/\/ \u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\u306e\u4f5c\u6210\nremoveMask();             \/\/ \u30de\u30b9\u30af\u306e\u524a\u9664\ndeleteBackGround();       \/\/ \u521d\u671f\u306e\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u524a\u9664\nrenameBackGround();       \/\/ \u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\u306e\u30ea\u30cd\u30fc\u30e0\n\nfunction createDocument(width, height){\n    preferences.rulerUnits = Units.PIXELS;  \/\/ \u5358\u4f4d\u3092\u8a2d\u5b9a\n    app.documents.add(width, height);       \/\/ \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u4f5c\u6210\uff08\u5e45, \u9ad8\u3055\uff09\n}\n\nfunction deleteBackGround(){\n    documentObject = activeDocument.artLayers;\n    documentObject[documentObject.length-1].remove();   \/\/ \u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u306e\u524a\u9664\n}\n\nfunction renameBackGround(){\n    documentObject = activeDocument.artLayers;\n    documentObject[documentObject.length-1].name = &quot;\u80cc\u666f&quot;;\n}\n\nfunction makeSolidFill(redC, greenC, blueC){\n    var idMk = charIDToTypeID( &quot;Mk  &quot; );\n    var desc15 = new ActionDescriptor();\n    var idnull = charIDToTypeID( &quot;null&quot; );\n    var ref4 = new ActionReference();\n    var idcontentLayer = stringIDToTypeID( &quot;contentLayer&quot; );\n    ref4.putClass( idcontentLayer );\n    desc15.putReference( idnull, ref4 );\n    var idUsng = charIDToTypeID( &quot;Usng&quot; );\n    var desc16 = new ActionDescriptor();\n    var idType = charIDToTypeID( &quot;Type&quot; );\n    var desc17 = new ActionDescriptor();\n    var idClr = charIDToTypeID( &quot;Clr &quot; );\n    var desc18 = new ActionDescriptor();\n    var idRd = charIDToTypeID( &quot;Rd  &quot; );\n    desc18.putDouble( idRd, redC); \/\/ Red\n    var idGrn = charIDToTypeID( &quot;Grn &quot; );\n    desc18.putDouble( idGrn, greenC); \/\/ Green\n    var idBl = charIDToTypeID( &quot;Bl  &quot; );\n    desc18.putDouble( idBl, blueC); \/\/ Blue\n    var idRGBC = charIDToTypeID( &quot;RGBC&quot; );\n    desc17.putObject( idClr, idRGBC, desc18 );\n    var idsolidColorLayer = stringIDToTypeID( &quot;solidColorLayer&quot; );\n    desc16.putObject( idType, idsolidColorLayer, desc17 );\n    var idcontentLayer = stringIDToTypeID( &quot;contentLayer&quot; );\n    desc15.putObject( idUsng, idcontentLayer, desc16 );\n    executeAction( idMk, desc15, DialogModes.NO );\n}\n\nfunction removeMask(){\n    var idDlt = charIDToTypeID( &quot;Dlt &quot; );\n    var desc21 = new ActionDescriptor();\n    var idnull = charIDToTypeID( &quot;null&quot; );\n    var ref5 = new ActionReference();\n    var idChnl = charIDToTypeID( &quot;Chnl&quot; );\n    var idMsk = charIDToTypeID( &quot;Msk &quot; );\n    ref5.putEnumerated( idChnl, idChnl, idMsk );\n    desc21.putReference( idnull, ref5 );\n    executeAction( idDlt, desc21, DialogModes.NO );\n}\n<\/code><\/pre><\/div>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4ee5\u4e0b\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u79fb\u52d5\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>C:\\Program Files\\Adobe\\Adobe Photoshop CC\\Presets\\Scripts\\<\/code><\/pre><\/div>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Photoshop\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">STEP.2 \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>[\u30d5\u30a1\u30a4\u30eb]<\/strong> \u2192 <strong>[\u30b9\u30af\u30ea\u30d7\u30c8]<\/strong> \u2192 <strong>[createCustomDocument]<\/strong> \u3092\u5b9f\u884c\u3002<\/li>\n\n\n\n<li><strong>\u30cf\u30fc\u30d5HD\u30b5\u30a4\u30ba\uff081280\u00d7720\uff09\u306e\u65b0\u898f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u4f5c\u6210\u3055\u308c\u3001\u80cc\u666f\u304c\u7dd1\u306e\u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\u306b\u306a\u308b\u3002<\/strong><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u65b0\u898f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u4f5c\u6210\u6642\u306b\u80cc\u666f\u3092\u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\u306b\u5909\u66f4\u53ef\u80fd<\/strong><\/li>\n\n\n\n<li><strong>Live2D\u3084\u52d5\u753b\u5236\u4f5c\u3001\u30b2\u30fc\u30e0UI\u306e\u7d20\u6750\u4f5c\u6210\u6642\u306b\u4fbf\u5229<\/strong><\/li>\n\n\n\n<li><strong>\u80cc\u666f\u3092\u524a\u9664\u30fb\u30ea\u30cd\u30fc\u30e0\u30fb\u5857\u308a\u3064\u3076\u3057\u3092\u81ea\u52d5\u5316\u3057\u3001\u4f5c\u696d\u3092\u52b9\u7387\u5316<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Photoshop\u306e\u4f5c\u696d\u3092\u30b9\u30e0\u30fc\u30ba\u306b\u3059\u308b\u305f\u3081\u306b\u3001 <strong>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u6d3b\u7528\u3057\u3066\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u7c21\u5358\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba<\/strong> \u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>Photoshop\u3067 \u65b0\u898f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3068\u540c\u6642\u306b\u3001\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u5857\u308a\u3064\u3076\u3057\u30ec\u30a4\u30e4\u30fc\u306b\u5909\u66f4 \u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001 \u30ef\u30f3\u30af\u30ea\u30c3\u30af\u3067\u6307\u5b9a\u30b5\u30a4\u30ba\u306e\u80cc\u666f\u3092\u4f5c\u6210 \u3067\u304d\u307e\u3059\u3002 \u30b9\u30af\u30ea\u30d7\u30c8\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":183,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[11],"tags":[9],"class_list":["post-182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-layer-shape-creation","tag-free"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/182","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=182"}],"version-history":[{"count":1,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":184,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/182\/revisions\/184"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media\/183"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media?parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/categories?post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/tags?post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}