summaryrefslogtreecommitdiff
path: root/scripts/access_action.lua
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2017-12-07 09:17:53 -0600
committerBen Loftis <ben@harrisonconsoles.com>2017-12-07 11:08:26 -0600
commitefc858dc8149f3b3456781451ef42dc69eee2d5e (patch)
treef4d121cd676dd23c950286fddd1aba52e649a105 /scripts/access_action.lua
parent561c8eea0cfa45f0b54461b149b4c330e0bbaa3b (diff)
Drop the "Lua" in Lua Action Buttons:
Removed the term "Lua", because users were turned off by something they didn't understand. A special-case Lua script ("Shortcut") allows the user to select an arbitrary Action. The "Shortcut" script is selected by default, and in this case there is no "Type" or "Author" displayed. Action-Buttons may still trigger Lua scripts, as a secondary function.
Diffstat (limited to 'scripts/access_action.lua')
-rw-r--r--scripts/access_action.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/access_action.lua b/scripts/access_action.lua
new file mode 100644
index 0000000000..b50c6386d8
--- /dev/null
+++ b/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