Closing the dialog window while using Photoshop action?

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

psNewbie
Posts: 2
Joined: Sat Oct 23, 2021 6:45 pm

Closing the dialog window while using Photoshop action?

Post by psNewbie »

Photoshop_OVeQbcvyWs.png
Photoshop_OVeQbcvyWs.png (4.81 KiB) Viewed 4366 times
I am coding with Python, and there was no problem because it was similar to JS.

I want to close the error dialog while using the doAction function.

ESC key was sent using win32api, but it does not work in the dialog. (It works in layers)

What function should I use?

=====================================================================
import win32gui
import win32con
import win32api

window= win32gui.FindWindow("Photoshop", None)
hwnd= win32gui.GetWindow(window, win32con.GW_CHILD)

win32api.PostMessage(hwnd, win32con.WM_KEYDOWN, 0x1B, 0) # 0x1B : ESC hexcode
win32api.PostMessage(hwnd, win32con.WM_KEYUP, 0x1B, 0)
Last edited by psNewbie on Tue Oct 26, 2021 2:26 am, edited 1 time in total.
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: Closing the dialog window while using Photoshop action?

Post by txuku »

Bonjour

jsx is not js and atn is different

You should code in JSX rather than any gear? :)
psNewbie
Posts: 2
Joined: Sat Oct 23, 2021 6:45 pm

Re: Closing the dialog window while using Photoshop action?

Post by psNewbie »

I run in visual studio code and use Photoshop python api.

https://loonghao.github.io/photoshop-python-api/
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Closing the dialog window while using Photoshop action?

Post by Kukurykus »

Photoshop is stuck while using action so you can't communicate with Ps at same time. Better find the reason why the dialog pops up to avoid it.