A minor addition in Drafts 45 that some may find useful: It is now possible to apply tint colors to buttons in scripted prompts. Mainly useful if you have a prompt with multiple buttons and want to create some visual separation between different functionality or groupings within the prompt.
To use, the addButton
function of the Prompt
object can now take an additional parameter specifying one of the valid tint colors (see docs for supported values). The available tint colors map to the same values available to select for actions and workspaces.
You can see this in action in the example “Colored Buttons” action, which produces the following:
A simple example script that adds several tinted buttons to a prompt:
let p = new Prompt()
p.title = "My Buttons"
p.addButton("My Red Button", "val1", false, false, "red")
p.addButton("My Green Button", "val2", false, false, "green")
p.show()