I can’t figure out how openURL works. I will be replacing the URLs with the KeyboardMaestri actions URLs but for the sake of figuring out how this works, I included basic links. Does not seem to work. Please advise,
editor.activate();
var one = ‘www.google.ca’;
var two = ‘www.duckduckgo.con’;
var p = Prompt.create();
p.title = “Export Report to Pages”;
p.message = “Which Clinic?”;
p.addButton(“one”);
p.addButton(“two”);
var didSelect = p.show();
if (p.buttonPressed == “one”) {
app.openURL(one);
}
else {Safari.openURL(‘www.google.ca’);
}
As @Andreas_Haberle notes, to make it a URL you need the protocol. It isn’t a URL without it.
But you have also added
else {Safari.openURL('www.google.ca');
}
but Safari is not a Drafts class and not one you have defined.
Try changing that to be app; maybe more like this.
else app.openURL('https://www.google.ca');
Also don’t forget to use triple back ticks for your code blocks to stop the forum changing some of the characters; you look to have used a comment block and it has and your quotation marks.