I have been developing a plug in for quite some time. For a few weeks I have used the export as png batch-play command to then load in a preview. A dirty solution, tbh.
Recently it has been failing to export and even the right-click and âQuick export as PNGâ also no longer opens the file explorer. I have no way, aside from hard restarting, to fix the issue.
@OliverOBrien Did you figure out a solution? I am also hitting this issue very regularly (multiple times a day). It seems to be related to the amount of time the âexportSelectionAsFileTypePressedâ BatchPlay action is called.
When this bug happens, then even the native PS âquick export as PNGâ will not work anymore either. The only solution I have found is the one described here: Quick Export as PNG not working after Photoshop 22⌠- Adobe Support Community - 12237643. But this requires all users of my plugin to restart PS multiple times a dayâŚ
Wondering if anyone knows a better fix, or alternatively another way to export a layer without going through âexportSelectionAsFileTypePressedâ ?
Itâs preferred to not use synchronousExecution. The replacement mechanism is executeAsModal. You can wrap the relevant script in it. This will require the use and/or migration to apiVersion 2, as outlined here.
I see that in @OliverOBrienâs sample that layers are being perhaps selectâed before attempting to export them. The _target is also invalid, as it contains both _enum and _id.
I would suggest retrieving the id of the relevant layer and updating the exportCommand with the following simplified _target.
This is indeed an internal bug with Photoshop. The only fix is to restart Photoshop and do a âFile > Quick export to PNGâ right after, before doing anything else. It will work then for about half an hour, until it breaks again.