Need to collapse actions on the Ps Actions panel played with the UXP .play() method or with batchPlay

One of the unfortunate differences between CEP and UXP is that when UXP code plays an action on Photoshop’s Actions panel, it expands that action to show all the steps contained in the action. This quickly messes up the Photoshop Actions panel if you go there to find an action or to add a new one. There is potentially lots of scrolling required to locate where you want to be in the Actions panel or the need to collapse numerous actions if they’ve been called from a UXP plugin. CEP didn’t expand actions when they were played using JSX code. Everything on the Actions panel stayed nice and neat.

Is this default action expansion a bug in UXP, or is it intentional? I can’t see that it serves any useful purpose.

Also, is there any batchPlay for collapsing a action’s steps once the action finishes executing after being called from a UXP plugin? Having this code would at least allow the plugin to clean up after itself.

NOTE: The unwanted action expansion occurs whether the action is played using the .play() Photoshop API or directly from batchPlay. There currently seems to be no workaround.

Example of expanded action after playing it via UXP below:

expanded-action

1 Like

I was looking into the issue and to me, it really seems like an unintended bug. I did not find any workaround and seems like something that has to be fixed in PS itself. To me, it seems like the same action manager code is interpreted differently in UXP vs in ExScript.

1 Like

We logged this bug into the internal issue tracker.

1 Like

Thanks for your attention to this issue. Fixing it will make me and other plugin users less frustrated with our Photoshop Actions panel.

1 Like

Hi Anthony,
When using batchPlay, you can get the CEP/ExtendScript behavior by including an “_options” argument and specify dontDisplay for dialogOptions.
Example:
let command = [
{“_obj”: “play”, “_target”:[{“_ref”:“action”,“_name”:“Action 1”},{“_ref”:“actionSet”,“_name”:“My Action Set”}], “_options”: {“dialogOptions”: “dontDisplay”}}
];
let result = await require(“photoshop”).action.batchPlay(command, {});

2 Likes

That seems to have fixed it, @jsbache. Thank you! However, I thought "_options": {"dialogOptions": "dontDisplay"}was the default and didn’t need to be added.

Regardless, I’ve set this as the new “Solution” to this problem. Glad I finally brought this up in Office Hours this morning and very much appreciate your input @jsbache.

Also, this works for playing actions via batchPlay, but not sure if it can be implemented with the .play() API.

Glad it worked. The default is “silent”. We are discussing tweaking the play implementation

Will also mention for @Jarda that Alchemist Listener doesn’t seem to capture the "_options": {"dialogOptions": "dontDisplay"} part of the batchPlay code either when running an action, unless I’ve turned on some toggle that suppresses it.

Wanted to be clear that the last comment was simply an observation and not a criticism of either @Jarda or Alchemist.

As far as I know, Photoshop does not provide a way to record it anyway. Only if you would use .ATN → Batchplay converter in Alchemist then it should be set correctly. Because .ATN file does contain such info but again… users have to set these manually in action panel.