{"id":1022,"date":"2022-04-12T00:11:00","date_gmt":"2022-04-12T00:11:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=1022"},"modified":"2022-04-12T00:11:00","modified_gmt":"2022-04-12T00:11:00","slug":"1022","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2022\/04\/12\/1022\/","title":{"rendered":"Adobe Illustrator \u62fc\u7248\u7528\u66ff\u6362\u7269\u4ef6\u5de6\u4e0a\u5bf9\u9f50\u811a\u672c"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/03\/2124898041.webp\" alt=\"AI\" title=\"AI\"><\/p>\n<h3>\u6628\u5929\u665a\u4e0a\u5b66\u4e60Adobe Illustrator \u7684JS\u811a\u672c\uff0c\u628a\u8001\u5916\u7684 <code>Adobe Illustrator \u62fc\u7248\u66ff\u6362\u5bf9\u9f50.jsx<\/code> \u5927\u6982\u770b\u4e86\u4e0b\uff0c\u91cd\u5199\u4e86\u4e2a\u62fc\u7248\u66ff\u6362\u7cbe\u7b80\u7248\uff0c\u65b9\u4fbf\u76f4\u63a5\u5de5\u4f5c\u4f7f\u7528<\/h3>\n<h2>\u66ff\u6362\u7269\u4ef6\u539f\u7248 \u548c \u7cbe\u7b80\u7248 <a href=\"https:\/\/github.com\/hongwenjun\/srgb\/tree\/master\/adobe_js\">\u6e90\u7801\u4e0b\u8f7d<\/a><\/h2>\n<h2><code>copy_to_replace.jsx<\/code> \u6e90\u7801\u672c\u7ad9\u5b66\u4e60<\/h2>\n<pre><code>\ufeffvar docRef = activeDocument;\n\/\/ \u5224\u65ad\u9009\u62e9\u7269\u4ef62\u4e2a\u4ee5\u4e0a\nif (docRef.selection.length &gt; 1) {\n    \/\/ \u5b9a\u4e49\u9009\u62e9\u7269\u4ef6\n    mySelection = docRef.selection;\n\n    \/\/ \u6700\u4e0a\u5c42\u7269\u4ef6\u4e3a\u66ff\u6362\u6e90\n    var sourceObj = docRef.selection[0];\n\n    \/\/ \u5b9a\u4e49\u6570\u7ec4\u7528\u6765\u4fdd\u5b58\u9009\u62e9\u7269\u4ef6\u7684\u5de6\u4e0a\u89d2\u5750\u6807\n    var alterObjectArray = new Array();\n    for (var i=0; i &lt; mySelection.length; i++) {\n        \/\/ PageItem.position  \u83b7\u5f97\u7269\u4ef6\u7fa4\u7ec4\u5de6\u4e0a\u89d2\u5750\u6807\n        var sel_xy = mySelection[i].position\n        alterObjectArray.push(sel_xy);\n    }\n    \/\/ \u5220\u9664\u7528\u6765\u5b9a\u4f4d\u7684\u4e0b\u5c42\u7269\u4ef6\n    for (var i=1; i &lt; mySelection.length; i++) {\n            mySelection[i].remove();\n    }\n    \/\/ PageItem.duplicate \u590d\u5236\u5bf9\u8c61, \u9700\u8981\u4e00\u4e2a\u76f8\u5bf9\u5bf9\u8c61\u5b9a\u4f4d\n    var newGroup = sourceObj.parent.groupItems.add();\n    for (var i=1; i &lt; alterObjectArray.length; i++) {\n        sourceObj.position = alterObjectArray[i];     \/\/ \u8bbe\u7f6e\u66ff\u6362\u7269\u7684\u5de6\u4e0a\u89d2\u4f4d\u7f6e\uff0c\u8fbe\u5230\u66ff\u6362\u76ee\u7684\n        sourceObj.duplicate(newGroup, ElementPlacement.PLACEATEND);\n    }\n  sourceObj.remove();\n}<\/code><\/pre>\n<h2>\u529f\u80fd\u6f14\u793a<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/03\/2827957994.gif\" alt=\"\" title=\"\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6628\u5929\u665a\u4e0a\u5b66\u4e60Adobe Illustrator \u7684JS\u811a\u672c\uff0c\u628a\u8001\u5916\u7684 Adobe Illustrat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,12],"tags":[51],"class_list":["post-1022","post","type-post","status-publish","format-standard","hentry","category-soft","category-learn","tag-adobe"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=1022"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1022\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}