Do remember to block your code with back ticks, otherwise we have to amend the code to remove all the stuff that Discourse does to it when you post.
Drafts’ call to
get doesn’t return x-success. x-success is the URL for Drafts to run on a successful x-callback run.
get appends the (URL encoded) draft text to the x-success URL as a parameter called
When the Scriptable script runs, we do want to access
args.queryParameters, but the result isn’t an array. It’s actually an object with the attributes of the parameters.
Finally, you probably also want to make the draft content the message rather than the title of the alert.
Maybe try it more like this:
let alert = new Alert()
alert.message = args.queryParameters.text;
alert.title = "Draft Content"
Hope that helps.