Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Rudi Claes on April 23, 2013, 08:25:26 pm
-
Hi,
is it possible to get user input from a script? I would like to get confirmation from a user to start a script.
In VBA this looks like:
iRet = MsgBox("Continue Y/N", vbYesNo, "Title")
In JavaScript, Session.Prompt works well for output, but I can't seem to get a response from Session.Input.
Any ideas on this one?
-
There's a Jscript example (Restore Baselines.js) that contains this:
Maybe it also works for JavaScript?
// This is a long operation and running it while testing is being done
// may have unexpected consequences. So prompt the user before beginning.
if(Session.Prompt("Are you sure you want to restore all test data to baseline?", promptYESNO) == resultYes)
{
Repository.ClearOutput("Script");
RestoreBaselinesInCollection(Models);
}
Geert
-
Does the trick :) Thx!