How To Capture When User Cancels A Dialog

I have some batchPlay code which opens the LayerStyles so the user can add a drop Shadow.

After they press OK, I have more code that does some things…

I am trying to capture and do something if they click the Cancel button in the Layer Style Dialog.

Maybe you could compare the before & after of the layerEffects? Or check for history state changes once the dialog is closed …

compare the before & after of the layerEffects worked great, thank you

If that batch play itself opens dialog then you can check what batchplay returns. I think for cancel there is some error code reserved.

https://developer.adobe.com/photoshop/uxp/2022/ps_reference/media/batchplay/#result-value

Error code -128