Drafts 35 Prompt.addButton question

The changelog for Drafts 35 says, “Prompt.addButton can now take an additional boolean parameter to mark the button as destructive.” Looking at the scripting site, I wasn’t sure if this referred to the isDefault boolean or if it was another parameter not yet documented. Thanks!

No there is a fourth optional parameter in the API.
So something like:

p.addButton(“title”, “value”, false, true)

The first Boolean parameter is the „isDefault“ and the second is the „isDestructive“ flag

The docs should be updated @agiletortoise

In case it helps, here’s the Slack discussion about it.

FWIW, the beta docs don’t seem to have the update either.

Pushed the update to the related docs, sorry about that.

1 Like

There’s a typo in “typically” (missing the “y”), and “interface” (an extra “e”).

Thanks everyone and thanks @agiletortoise for such a great year of Drafts! Happy new year!

1 Like