Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error when running .jsx (ES) file via Python in Photoshop 2025, but working in Photoshop 2024

New Here ,
Mar 28, 2025 Mar 28, 2025

Hi all,

 

I have a question regarding running ExtendedScript files via Python in Photoshop 2025: Has something changed under the hood that does impact this?

 

Thing is, I have various scripts in .jsx file format that run perfectly fine when I run them from Python + COM in Photoshop 2024 via Visual Studio Code, but when I run the exact same scripts in Photoshop 2025 Visual Studio Code they always give exactly the same error: 

pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Adobe Photoshop', 'Illegal argument - argument 1\n- Required value is missing', None, 0, -2147220262), None)

 

Even a .jsx only containing a very simple 

alert("Hello from Photoshop");

will give exactly the same error in Photoshop 2025 but not in Photoshop 2024 (Visual Studio Code). 

 

Now, when I run all these scripts directly inside Photoshop (2024/2025) via the scripts menu, they also work. So the issue seems to be specifically when sending the scripts to Photoshop via Python.

 

In Python, my code is (simplyfied) the following:

def run_jsx_windows(jsx_script_path, file):
    try:
        
        #Start Photoshop via COM
        app = win32com.client.Dispatch("Photoshop.Application")

        #Check if Photoshop is initialized
        if app is None:
            print("Photoshop not initialized")
            return   
               
        result = app.DoJavaScript(jsx_code)

The variable jsx_code is simply the external .jsx file I'm trying to run. Path to it is compiled via the os.path module inside Python.

But again to stress this all works perfectly fine in Photoshop 2024, but not in Photoshop 2025.

 

Can anybody clarify what has changed "under the hood" that Photoshop 2025 no longer seems to be liking this way of addressing it?

 

Cheers,

Joep

TOPICS
PS Automation API , Scripting
197
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation