diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-23 20:48:02 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-23 20:48:02 +0100 |
commit | 180843f9bd28b191c7404245ba0a121107992511 (patch) | |
tree | c60312dc09f76c2f55ba2383245c427e15c38dea /share/scripts/access_action.lua | |
parent | bf649cd68ad46c34a656700aa6cb89416d648c64 (diff) |
Also move Lua scripts to share subfolder
Diffstat (limited to 'share/scripts/access_action.lua')
-rw-r--r-- | share/scripts/access_action.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/share/scripts/access_action.lua b/share/scripts/access_action.lua new file mode 100644 index 0000000000..b50c6386d8 --- /dev/null +++ b/share/scripts/access_action.lua @@ -0,0 +1,37 @@ +ardour { + ["type"] = "EditorAction", + name = "Shortcut", + license = "MIT", + author = "me", + description = [[Trigger a keyboard shortcut. You will be prompted for the shortcut's action in the next step.]] +} + +function action_params () + local actionlist = { + { + type = "dropdown", key = "action", title = "Action", values = ArdourUI:actionlist(), + default = "Save" + } + } + + local rv = LuaDialog.Dialog ("Select Action", actionlist):run () + if not rv then -- user cancelled + return { ["x-script-abort"] = { title = "", preseeded = true} } + end + + local action = rv["action"] + local name = "Shortcut - " .. action + return { + ["action"] = { title = "Action to trigger", default = action, preseeded = true}, + ["x-script-name"] = { title = "Unique Script name", default = name, preseeded = true}, + } +end + +function factory (params) return function () + local p = params or { } + local as = assert (p["action"]) + local sp = assert (as:find('/')) + local group = assert (as:sub(0, sp - 1)) + local item = assert (as:sub(1 + sp)) + Editor:access_action (group, item) +end end |