Skip to content

Instantly share code, notes, and snippets.

@derickfay
Created April 23, 2018 21:18
Show Gist options
  • Save derickfay/defb2046c01300c76b06533e7f500401 to your computer and use it in GitHub Desktop.
Save derickfay/defb2046c01300c76b06533e7f500401 to your computer and use it in GitHub Desktop.
Broken prompt
// See online documentation for examples
// http://getdrafts.com/scripting
var p = Prompt.create();
p.title = "";
p.message = "";
p.addButton("Add to draft");
p.addTextField("Enter text", "t","");
var con = p.show();
if (con) {
t = p.fieldValues("t")
}
else {
context.cancel();
}
Editor.setSelectedText(t);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment