Copy link to clipboard
Copied
hi we search the event id (int number) into event list for "do action" / "edit content layer" / "update modified content"
Copy link to clipboard
Copied
So all three event codes?
Copy link to clipboard
Copied
yes only this 3
Copy link to clipboard
Copied
I'm not in front of a computer at the moment... The last two sound like they are related to smart object layers. Is the first on is it triggered by running an action or calling an action from a script?
Copy link to clipboard
Copied
hi we have photoshop 22 (and soon 23) we want do this script with python
import logging
import multiprocessing
import os
from time import sleep
import tkfilebrowser
import win32com.client
delay=0.1
def filter_file_to_export(file_name):
result = False
if file_name[-4:] == '.psd':
result = True
return result
def main():
""" Main program """
logging.info("dƩbut de programme")
try:
app = win32com.client.Dispatch('photoshop.Application')
except :
logging.error('logiciel non trouvƩ')
#app.activeDocument.ActiveLayer = app.activeDocument.Layers.Item('<< Doubleclick to change etiquette')
for layer in app.activeDocument.Layers:
if layer.name == '<< Doubleclick to change etiquette':
app.activeDocument.ActiveLayer = layer
app.DoAction("EditContent", "Ensemble1")
for layer in app.activeDocument.Layers:
if layer.name == 'Ʃtiquette finie':
app.activeDocument.ActiveLayer = layer
app.DoAction("update pdf", "Actions par dƩfaut")
logging.info("fin de programme")
return 0
if __name__ == "__main__":
# logging pour les erreur, info ...
level = logging.INFO
fmt = '[%(levelname)s] %(asctime)s - %(message)s'
logging.basicConfig(format=fmt, level=level)
main()
my neighbour can do an action with script with photoshop 2020, but not my 22
we have this error
Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\infographie\AppData\Roaming\Python\Python37\site-packages\win32com\client\dynamic.py", line 628, in __getattr__ ret = self._oleobj_.Invoke(retEntry.dispid, 0, invoke_type, 1) pywintypes.com_error: (-2147352567, 'Une exception sāest produite.', (0, 'Adobe Photoshop', 'Argument illĆ©gal - argument 1\n- Valeur requise manquante', None, 0, -2147220262), None)
Copy link to clipboard
Copied
hi, into my codeline with doaction not work
and we can select a layer with name
but we want, modify content to this layer (it will open Ć new "windows")
in this new windows we will select a (dynamical) smart object and we want update the content (linked with external file)
but we do not find edit content and update content code
and we can register an action and play it, but doaction code not worke with python
thanks inadvance
Copy link to clipboard
Copied
@laurence roussel12011930 ā I don't know about Python, only Javascript.
"do action" = What exactly do you mean? How does one select this menu item or perform this command?
"edit content layer" = placedLayerEditContents
"update modified content" = placedLayerUpdateModified
Copy link to clipboard
Copied
hi, do action is play an action register with alt+f9
Copy link to clipboard
Copied
OK, this is probably
'ply ' (don't include the single quotes, this is four total characters, three characters plus a space character)
or perhaps
play
Feedback on these various replies would be appreciated.
Copy link to clipboard
Copied
ok will try