I am looking for a way to rename a device with a user specified name. I would like to prompt the user for the asset number and then use that in the device name. I got that information with a Java script:
var file = new mobicontrol.io.File('/sdcard/asset.txt');
mobicontrol.message.createTextPromptDialog('What is the asset tag number?')
.withCallback(onOk).show();
function onOk(result) {
if (result.inputText != null) {
file.writeText(result.inputText);
}
}
But when I try to use that information to rename the device I get an error saying Set isn't a valid command:
set myVar=TXT:/sdcard/asset.txt?LN=1
devrename %myVar%
Is there a way to either do this all in 1 Java script command? Or is there a way to set the variable from the legacy script?