Calling legacy script command from javascript

ST
Shawn T Bronze Contributor
Supply Chain Services LLC

Hello,

I'm looking for a way to call a legacy script command from within a post-sync script using javascript. Currently testing the with this sample code and based on selection, would like to trigger the mxconfig command, which is part of the legacy scripting. 

#!/usr/bin/env js
var buttonLabels = ['Red', 'Green', 'Blue'];
mobicontrol.message.createInfoDialog('Choose the colour').withButtons(buttonLabels[0], buttonLabels[1], buttonLabels[2]).withCallback(onConfirm).show();

function onConfirm(result) {
    if (result.buttonIndex != null) {
        mobicontrol.log.info('The ' + buttonLabels[result.buttonIndex] + ' button was clicked.');
    }
}

Finding a way to combine the functionality of both scripting languages would be very helpful.

- Shawn
5 years ago
MobiControl - Android Script Engine
ANSWERS
MD
Matt Dermody
5 years ago

I see what you're trying to do and I like it. Would love to have conditional triggering of a lot of device actions.

A LifeGuard update is available, would you like to install now? - Yes / Delay 6 Hours

TB
TJ Bukoski
5 years ago

We have plans to add mxconfig to the Android Javascript engine next year as a new Javascript API.

I recommend talking to your SOTI rep to file a feature request and have him see if he can increase the priority of the FR. You might see it sooner.

MD
Matt Dermody
5 years ago
ST
Shawn T
5 years ago

Thanks TJ.

I will submit the feature request. What would be really helpful would be to able to call a legacy script from javascript. This would allow for using the full features of both without waiting for features to be ported over one by one. Sending an intent would be next on my list.