Help With Filling A Layer With Black Using Alchemist

I have recorded a step which fills a layer with black but my issues is that when you go to Photoshop - Edit Undo Fill is Grayed Out and I dont know why.

await batchPlay(
      [
         {
            "_obj": "fill",
            "using": {
               "_enum": "fillContents",
               "_value": "black"
            },
            "opacity": {
               "_unit": "percentUnit",
               "_value": 100
            },
            "mode": {
               "_enum": "blendMode",
               "_value": "normal"
            },
            "_isCommand": true,
            "_options": {
               "dialogOptions": "dontDisplay"
            }
         }
      ],{
         "synchronousExecution": false,
         "modalBehavior": "fail"
      });

After further investigation, it turns out that this issue appeard to be connected with when we use the menuCommand as a workaround for the “Lost Focus” problems.

    menuCommand(2982);
    menuCommand(2986);
    menuCommand(2986);

Not using these makes it work OK.

Boy… this Lost focus issue is really making me feel frustrated …

Yes, however I’d rather sacrifice Undo and preserve keyboard focus and shortcuts and keep on using the hack. Until the new API comes to the rescue at least :wink:

1 Like