howto gui.action_fields_and_options - deekayhd/lua-scripts GitHub Wiki

I want to use a shortcut with darktable.gui.action(), but I don't know what fields and options are available.

The darktable.gui.action() command uses the following syntax:

darktable.gui.action(
  path : string,
  [instance] : integer,
  element : string,
  [effect] : string,
  [speed] : integer
)

To quickly capture the default command for a specific UI element:

  • switch to the mapping mode for shortcuts
  • hover over the specific UI element (button, slider, combo box, etc.).
  • Once the tooltip is shown, perform long right-click to copy the default command to the clipboard.

alt text

In this example, the default command is

dt.gui.action("lib/export/set size", "selection", "item:in pixels (for file)", 1.000)

with the following parameters:

  • Path : "lib/export/set size"
  • Element : "selection"
  • Effect : "item:in pixels (for file)"

While the steps above provide the default command, the element and effect parameters often support alternative values. To identify all available options for a specific path, proceed as follows:

  1. Go to the shortcuts section in the preferences module and locate the item you want to manipulate

alt text

  1. Assign a shortcut to it and select it

alt text

  1. click on the fields to see what's available

alt text

alt text

⚠️ **GitHub.com Fallback** ⚠️