loonghao / photoshop-python-api

Python API for Photoshop.
https://loonghao.github.io/photoshop-python-api/
MIT License
604 stars 68 forks source link

How to Open Smart Object; #273

Closed kkgg0521 closed 1 month ago

kkgg0521 commented 1 year ago

How to open a smart object in my PSD?

lzzkey commented 11 months ago

I have similar problems. I need to use ps to change the pictures in the smart layer in batches and export them, but I can't find a way to operate the smart layer in the document.

kkgg0521 commented 11 months ago

def openSmartObject(self): a = ps.Application().stringIDToTypeID("placedLayerEditContents") d = ps.ActionDescriptor() ps.Application().executeAction(a, d) hello i Solved this problem on my own

lzzkey commented 11 months ago

Thank you very much. I have succeeded in using your plan. Thank you.

wangxshuai commented 10 months ago

def openSmartObject(self): a = ps.Application().stringIDToTypeID("placedLayerEditContents") d = ps.ActionDescriptor() ps.Application().executeAction(a, d) hello i Solved this problem on my own

前辈你这个问题帮助了我很多,我还有一些问题想请教,我现在想在你的解决方法的基础上,替换新打开的智能对象中文字,我现在打开智能对象后就不知道该如何去操作了,情不能指教一下,非常感谢!

import photoshop.api as ps App = ps.Application() doc = App.load('*.psd')

a = App.stringIDToTypeID("placeLayerEditContents") b = ps.ActionDscriptor() App.executeAction(a,b)

now I open the smart object, but i have no idea to change the text in the opened smart object, how to seleted the opened smart object layer,? And how to change the text in the opened smart object layer ?

PcAlien commented 4 months ago

Mhh.. that is not working for me. Photoshop complains (translated): The command "" is not available" Any ideas?