Hey guys,
I'm trying to wrap parts of Google Apps Script in Nim (Javascript). I've been having some success but I'm really perplexed on how to handle this part...
proc complexAlert =
var ui = DocumentApp.getUi()
var resp = ui.alert("Confirm","Do you want to continue?", ui.ButtonSet.YES_NO) #last param is an enum
if resp == ui.Button.YES: #this is an enum too
Logger.log("The answer was No")
else:
Logger.log("The answer was No")
Notice the last param for the alert proc and the comparison in the if statement. It's REQUIRED that the code is generated exactly like this but I'm not able to get it working. I've only been able to generate javascript where instead of ui.ButtonSet.YES_NO, for example, it would be 3 in its place (which is the enums value).
Is there a way to get the entire expression in the code like what you see above?
Excuse me if this sounds a little confusing, it's late in the States. And I'm not quite sure how I'm supposed to be asking this question exactly
Unfortunately not, I spent today going down that path. I'm thinking that it's just the way Apps Script works, like there's a runtime check or something that requires a fully qualified enum with the expression.
I'm currently learning the jsffi module, we'll see where that takes me