I'm trying to get a simple dialog to show for a workflow I'm working on, but using JXA I keep getting the error: Expecting object specifier, argument has no object specifier. I don't know what to pass in for the object Specifier. My code is below, it takes issue at line 11 where I call the dialog
function run() {
app = Application.currentApplication();
app.includeStandardAdditions = true;
//Error Here
var who = app.displayDialog('Whose server is this?', {
withTitle: 'Whose Server...'
})
return who
}
Read this unofficial cookbook about User-Interactions, it helps me about these alert things.
In details:
function prompt(text, defaultAnswer) {
var options = { defaultAnswer: defaultAnswer || '' }
try {
return app.displayDialog(text, options).textReturned
} catch (e) {
return null
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With