Skip to main content
Inspiring
February 1, 2023
Question

event id

  • February 1, 2023
  • 3 replies
  • 1280 views

hi we search the event id (int number) into event list for "do action" / "edit content layer" / "update modified content"

This topic has been closed for replies.

3 replies

Stephen Marsh
Community Expert
Community Expert
February 3, 2023

@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

 

 

Inspiring
February 3, 2023

hi, do action is play an action register with alt+f9

Stephen Marsh
Community Expert
Community Expert
February 3, 2023

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.

Stephen Marsh
Community Expert
Community Expert
February 1, 2023

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?

Inspiring
February 1, 2023

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)

Stephen Marsh
Community Expert
Community Expert
February 1, 2023

So all three event codes?

Inspiring
February 1, 2023

yes only this 3