lua scripting: reject image and move to the next

When culling I usually filter for >0 stars, cull images with r and move to the next with the spacebar (usually in darkroom so I can apply basic edits). I am trying to combine both within one keypress (as I was used to from, sorry, lightroom).

Got the following lua script from copying the provided lua commands from the shortcuts-view but it only rejects and doesnt move foward.

Any idea why?

local dt = require "darktable"
local function reject_next_shortcut(event, shortcut)
dt.gui.action("views/thumbtable/rating", "reject", "activate", 1.000)
dt.gui.action("views/lightroom/move/horizontal", "move", "next", 1.000)
end

dt.register_event("reject_next_shortcut",
                  "shortcut",
                  reject_next_shortcut,
                  "A shortcut that rejects the current image and moves to the next")

Okay, I found it now… For posterity:

dt.gui.action("views/lightroom/move/horizontal", "move", "next", 1.000)

is apparently the wrong action - it needed:


dt.gui.action("views/darkroom/image forward", 1.000)

Rubberducking for the win.

3 Likes

You needed image forward because you were in darkroom.