{"id":124,"date":"2025-03-18T15:53:19","date_gmt":"2025-03-18T06:53:19","guid":{"rendered":"https:\/\/cg-method.com\/photoshop\/?p=124"},"modified":"2025-03-18T16:18:37","modified_gmt":"2025-03-18T07:18:37","slug":"copy-guides","status":"publish","type":"post","link":"https:\/\/cg-method.com\/photoshop\/copy-guides\/","title":{"rendered":"Photoshop\u30b9\u30af\u30ea\u30d7\u30c8\uff08jsx\uff09\u2502\u30ac\u30a4\u30c9\u3092\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>Photoshop\u3067\u30b9\u30e9\u30a4\u30b9\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u969b\u3001 <strong>\u30ac\u30a4\u30c9\u3092\u5225\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u30b3\u30d4\u30fc\u3057\u305f\u3044<\/strong> \u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001Photoshop\u306b\u306f <strong>\u30ac\u30a4\u30c9\u3092\u76f4\u63a5\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3059\u308b\u6a5f\u80fd\u304c\u3042\u308a\u307e\u305b\u3093<\/strong>\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u3001 <strong>\u300cCopyGuides.jsx\u300d\u30b9\u30af\u30ea\u30d7\u30c8<\/strong> \u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30ac\u30a4\u30c9\u3092\u7c21\u5358\u306b\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u305d\u306e\u624b\u9806\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Photoshop\u3067\u30ac\u30a4\u30c9\u3092\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3059\u308b\u65b9\u6cd5<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">STEP.1 \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30fc\u3057\u3066\u30e1\u30e2\u5e33\u306a\u3069\u306b\u8cbc\u308a\u4ed8\u3051\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>CopyGuides.jsx<\/code> \u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\"> <strong>\u30ac\u30a4\u30c9\u3092\u30b3\u30d4\u30fc\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/strong><\/h4>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>#target photoshop\nmain();\nfunction main(){\nif(Number(app.version.match(\/\\d+\/)) &lt;12) return;\nif(!documents.length) return;\nvar startRulerUnits = app.preferences.rulerUnits;\napp.preferences.rulerUnits = Units.PIXELS;\nif(ScriptUI.environment.keyboardState.shiftKey ){\n    setGuides();\n    }else{\n        displayGuides();\n        }\napp.preferences.rulerUnits = startRulerUnits;\nfunction setGuides(){\nvar guides = app.activeDocument.guides;\nif(guides.length == 0){\n    alert(&quot;No guides exist&quot;);\n    return;\n    }\nvar gH = &#39;&#39;;\nvar gV = &#39;&#39;;\nfor( var g = 0; g &lt; guides.length; g++ ){\n    if(guides[g].direction.toString() == &#39;Direction.HORIZONTAL&#39;){\n        gH+=(parseInt(guides[g].coordinate.value));\n        gH+=&#39;,&#39;;\n        }else{\n            gV+=(parseInt(guides[g].coordinate.value));\n            gV+=&#39;,&#39;\n            }\n}\ngH=gH.replace(\/,$\/,&#39;&#39;);\ngV=gV.replace(\/,$\/,&#39;&#39;);\ncurrentGuides = &#39;Layer Guides&#39; + &quot;\u2318&quot; + gH + &quot;\u2318&quot; + gV;\nvar desc2 = new ActionDescriptor();\ndesc2.putString(0, currentGuides.toSource());\napp.putCustomOptions(&#39;7a301ec0-afde-11e1-afa6-0800200c9a66&#39;, desc2, true );\n}\nfunction displayGuides(){\ntry{\nvar desc1 = app.getCustomOptions(&#39;7a301ec0-afde-11e1-afa6-0800200c9a66&#39;);\nvar layerGuides = eval(desc1.getString(0));\n    }catch(e){return;}\nclearGuides();\nvar ar1 = layerGuides.toString().split(&#39;\u2318&#39;);\nvar Hor = ar1[1].toString().split(&#39;,&#39;);\nvar Ver = ar1[2].toString().split(&#39;,&#39;);\nfor(var H in Hor){\n    activeDocument.guides.add(Direction.HORIZONTAL,new UnitValue(Number(Hor[H]),&#39;px&#39;));\n    }\nfor(var V in Ver){\n    activeDocument.guides.add(Direction.VERTICAL,new UnitValue(Number(Ver[V]),&#39;px&#39;));\n    }\n}\n}\nfunction clearGuides() {\n   var id556 = charIDToTypeID( &quot;Dlt &quot; );\n       var desc102 = new ActionDescriptor();\n       var id557 = charIDToTypeID( &quot;null&quot; );\n           var ref70 = new ActionReference();\n           var id558 = charIDToTypeID( &quot;Gd  &quot; );\n           var id559 = charIDToTypeID( &quot;Ordn&quot; );\n           var id560 = charIDToTypeID( &quot;Al  &quot; );\n           ref70.putEnumerated( id558, id559, id560 );\n       desc102.putReference( id557, ref70 );\n   executeAction( id556, desc102, DialogModes.NO );\n};<\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">STEP.1 Photoshop\u3092\u8d77\u52d5<\/h3>\n\n\n\n<p>\u30b3\u30d4\u30fc\u3057\u305f\u3044\u30ac\u30a4\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u308b <strong>PSD\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u307e\u3059<\/strong>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">STEP.2 \u30ac\u30a4\u30c9\u3092\u30b3\u30d4\u30fc<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>[\u30d5\u30a1\u30a4\u30eb]<\/strong> \u2192 <strong>[\u30b9\u30af\u30ea\u30d7\u30c8]<\/strong> \u2192 <strong>[\u53c2\u7167]<\/strong> \u3092\u958b\u304f\u3002<\/li>\n\n\n\n<li><code>Shift\u30ad\u30fc<\/code> \u3092\u62bc\u3057\u306a\u304c\u3089 <code>CopyGuides.jsx<\/code> \u3092\u9078\u629e\u3002<\/li>\n\n\n\n<li>\u3053\u308c\u3067 <strong>\u30ac\u30a4\u30c9\u304c\u30b3\u30d4\u30fc<\/strong> \u3055\u308c\u307e\u3057\u305f\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">STEP.3 \u5225\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u30ac\u30a4\u30c9\u3092\u30da\u30fc\u30b9\u30c8<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>\u30ac\u30a4\u30c9\u3092\u8cbc\u308a\u4ed8\u3051\u305f\u3044PSD\u30d5\u30a1\u30a4\u30eb<\/strong> \u3092\u958b\u304f\u3002<\/li>\n\n\n\n<li><strong>[\u30d5\u30a1\u30a4\u30eb]<\/strong> \u2192 <strong>[\u30b9\u30af\u30ea\u30d7\u30c8]<\/strong> \u2192 <strong>[\u53c2\u7167]<\/strong> \u3092\u958b\u304d\u3001<code>CopyGuides.jsx<\/code> \u3092 <strong>\u901a\u5e38\u901a\u308a<\/strong> \u5b9f\u884c\u3002<\/li>\n\n\n\n<li>\u3053\u308c\u3067\u30ac\u30a4\u30c9\u304c\u30da\u30fc\u30b9\u30c8\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full is-style-border\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"413\" src=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/20170225132838-768x413-1.jpg\" alt=\"\" class=\"wp-image-125\" srcset=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/20170225132838-768x413-1.jpg 768w, https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/20170225132838-768x413-1-300x161.jpg 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\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>Photoshop\u306b\u306f\u30ac\u30a4\u30c9\u3092\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3059\u308b\u6a5f\u80fd\u304c\u306a\u3044<\/strong><\/li>\n\n\n\n<li><strong>\u300cCopyGuides.jsx\u300d\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u3046\u3068\u7c21\u5358\u306b\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u53ef\u80fd<\/strong><\/li>\n\n\n\n<li><strong>Shift\u30ad\u30fc\u3092\u62bc\u3057\u306a\u304c\u3089\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u30ac\u30a4\u30c9\u3092\u30b3\u30d4\u30fc<\/strong><\/li>\n\n\n\n<li><strong>\u901a\u5e38\u901a\u308a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u30ac\u30a4\u30c9\u3092\u30da\u30fc\u30b9\u30c8<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u6d3b\u7528\u3059\u308c\u3070\u3001 <strong>\u5225\u306ePSD\u30d5\u30a1\u30a4\u30eb\u306b\u30ac\u30a4\u30c9\u3092\u7c21\u5358\u306b\u8ee2\u9001\u3067\u304d\u308b<\/strong> \u306e\u3067\u3001\u305c\u3072\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Photoshop\u3067\u30b9\u30e9\u30a4\u30b9\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u969b\u3001 \u30ac\u30a4\u30c9\u3092\u5225\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u30b3\u30d4\u30fc\u3057\u305f\u3044 \u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 \u3057\u304b\u3057\u3001Photoshop\u306b\u306f \u30ac\u30a4\u30c9\u3092\u76f4\u63a5\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3059\u308b\u6a5f\u80fd\u304c\u3042\u308a\u307e\u305b\u3093\u3002 \u305d\u3053\u3067\u3001 \u300cCopyGuide [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":126,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[12],"tags":[9],"class_list":["post-124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-env","tag-free"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/124","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=124"}],"version-history":[{"count":3,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/124\/revisions\/136"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media\/126"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}