Example of how maxscript uses OLE to operate phtoshop, combining several images into PSD by Layer

Source: Internet
Author: User

It is also a problem of netizens in the QQ Group. In fact, if it is only merged into a PSD, you can also find the. NET library. However, most of the libraries can only be read and cannot be written because of PSD authorization issues. In addition, to popularize Ole. However, this code is only available in CS6, and may be changed in other Photoshop versions.

 

FN combinetexturetopsd inputsourcearray inputsavepsdfile photoshopexit: true = (if inputsourcearray. count> 1 do (Global photoshopapplication = createoleobject "Photoshop. application "for tempfilename in inputsourcearray do (photoshopapplication. load tempfilename) for I = 2 to inputsourcearray. count do (photoshopapplication. activedocument = photoshopapplication. specified ents I photoshopapplication. activedocument. selection. selectall () photoshopapplication. activedocument. selection. copy () photoshopapplication. activedocument = photoshopapplication. documents 1 photoshopapplication. activedocument. paste () photoshopapplication. activedocument. saveas inputsavepsdfile/* earlier versions may be photoshopapplication. documents. length */while photoshopapplication. documents. count> 0 do photoshopapplication. activedocument. close 2 if photoshopexit = true do (photoshopapplication. quit () releaseoleobject photoshopapplication = undefined GC () combinetexturetopsd # ("D: \ test \ test1.png", "d :\\ test \ test2.png ") "D: \ test. PSD"

 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.