Python控制Photoshop(Python+Com)
Python控制Photoshop(Python+Com)
#这个脚本演示了如何控制PhotoshopCS。 #功能:打开D:\\32.bmp文件 from win32com.client import Dispatch
PHApp = Dispatch("Photoshop.Application")
numDocs = PHApp.Documents.count
if numDocs ==0 :
docRef = PHApp.Open("D:\\32.bmp")
else:
docRef = PHApp.ActiveDocument
#jpgSaveOptions = Dispatch("Photoshop.JPEGSaveOptions") #print jpgSaveOptions #jpgSaveOptions =PHApp.JPEGSaveOption