krutmaster

win32com.client.Dispatch

Sep 18th, 2021
666
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import win32com.client  # pywin32
  2. import os
  3.  
  4. psApp = win32com.client.Dispatch("Photoshop.Application")
  5. psApp.Open('test.psd')
  6. doc = psApp.Application.ActiveDocument
  7. layer_facts = doc.ArtLayers["номер"]
  8. text_of_layer = layer_facts.TextItem
  9. text_of_layer.contents = "This is an example of a new text."
RAW Paste Data