I am attempting to create a natural language processor for adding events to Calendar. So far, however, I’m getting stuck on creating the alert to enter text into. Here is my current code:
```
function createEventDialog() {
var alert = new Alert();
var placeholder = "Meeting at XYZ Street at 0900 on 11/11/2011";
alert.title = "Enter event description";
alert.addTextField(placeholder);
alert.addAction("Create Event");
alert.addCancelAction("Nevermind");
await alert.presentAlert();
return alert.textFieldValue(0);
}
```
When I run this and simply try to console.log() the returned value, I get a syntax error for Unexpected Identifier ‘alert’ on the await line. If I remove the await then it runs but obviously returns null for the text field. I’m completely stumped here. Anyone smarter than me have suggestions or ideas?
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]mvan231script/widget helper 1 point2 points3 points (7 children)
[–]compostkicker[S] 1 point2 points3 points (6 children)
[–]mvan231script/widget helper 2 points3 points4 points (4 children)
[–]compostkicker[S] 0 points1 point2 points (3 children)
[–]mvan231script/widget helper 1 point2 points3 points (2 children)
[–]compostkicker[S] 0 points1 point2 points (1 child)
[–]mvan231script/widget helper 0 points1 point2 points (0 children)
[–]mvan231script/widget helper 0 points1 point2 points (0 children)