mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 17:46:34 +01:00
Add an action script to call access actions..
This commit is contained in:
parent
b6124f0189
commit
a499c7139f
1 changed files with 37 additions and 0 deletions
37
scripts/_access_action.lua
Normal file
37
scripts/_access_action.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
ardour {
|
||||||
|
["type"] = "EditorAction",
|
||||||
|
name = "Shortcut",
|
||||||
|
license = "MIT",
|
||||||
|
author = "me",
|
||||||
|
description = [[Shortcut call any action]]
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue