Hi,
I'm trying to trigger an interactive automation script from protocol.
It looks like DM is unable to find my client. Below you can see this with the first highlighted entry from the SLAutomation logging. When triggering the script from the automation module then it does find my client and I get the pop-up (second highlighted entry). When doing this through the SLNet client test tool by triggering an ExecuteScriptMessage I get the same behavior. My options are given below. The User cookie is retrieved by logging it from the QAction.
Does anyone know what I'm missing?
OPTIONS:0
CHECKSETS:TRUE
EXTENDED_ERROR_INFO
DEFER:TRUE
PARAMETER:2:test
USER:3D061CEB9EF743F398A5416A845E0A87
INTERACTIVE
Hi,
Found the trick.
You need to add the following at the beginning of your automation script:
engine.FindInteractiveClient("message test", 5, "user:"+engine.UserLoginName, AutomationScriptAttachOptions.AttachImmediately);
Then trigger the automation script with the following options from your QAction:
string[] scriptOptions =
{
"OPTIONS:0",
"CHECKSETS:TRUE",
"EXTENDED_ERROR_INFO",
"DEFER:TRUE",
$"PARAMETERBYNAME:Input:{input}",
$"USER:{protocol.UserCookie}",
};
SLNetMessages.ExecuteScriptMessage message = new SLNetMessages.ExecuteScriptMessage(scriptName)
{
Options = new SLNetMessages.SA(scriptOptions),
};
var response = protocol.ExecuteScript(message);
Hi Jarno,
Think you are confusing two things.
To indicate that the script is interactive you need somewhere the following line can be commented out as you say:
// engine.ShowUI()
When triggering an automation script from somewhere else you need to attach it to the client, for that you need to use the engine.FindInteractiveClient function.
Yes, you’re right Michiel!
Hi Michiel, I think you even can have the line commented out in your script. It just needs to be present in the present in the Automation Script.