Action

Colored Buttons

Posted by agiletortoise, Last update about 2 months ago

Demo action showing how to use tinted buttons in scripting prompts, a new feature added in Drafts 45. Details in the Prompt scripting reference.

Steps

  • script

    // demostrate new tinted button options
    let p = new Prompt()
    
    let colors = [
        "gray",
        "red",
        "pink",
        "orange",
        "yellow",
        "green",
        "blue",
        "indigo",
        "violet"
    ]
    
    p.title = "Button Colors"
    p.message = "Drafts 45 added the ability to tint buttons in scripted prompts."
    
    for (let c of colors) {
    	p.addButton(c, c, false, false, c)
    }
    
    p.show()

Options

  • After Success Nothing
    Notification None
    Log Level None
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.