Open the curves adjustment layer dialog

I am working on a plugin and I want to have a way to create a curves adjustment layer and show the full modal (not just the panel) and also have a separate button to re-open that same modal after the layer is created.

I figured out how to get the modal open while creating a new curves adjustment layer.

export const createCurvesLayer = async () => {
  const descriptors = [
    {
      _obj: "make",
      _target: [
        {
          _ref: "adjustmentLayer",
        },
      ],
      using: {
        _obj: "adjustmentLayer",
        type: {
          _obj: "curves",
          presetKind: {
            _enum: "presetKindType",
            _value: "presetKindDefault",
          },
        },
      },
      _isCommand: true,
      _options: {
        dialogOptions: "display",
      },
    },
  ];
  const results = await action.batchPlay(descriptors, {
    // modalBehavior: "execute",
  });

With this code I get these two modals:

Setting the ‘dialogOptions’ to display shows both the layer options modal and the modal I am after.

How can I:

  • Skip the ‘new layer options modal’ and just show the ‘curves modal’.
  • Re-launch the ‘curves modal’ after the action curves adjustment layer is added and the original modal is closed. (edit adjustment layer curves, separate from this batch play)