Script Commands - Environmental Variable not working

SW
Sam Walker
Flowstore Systems Ltd

I'm new to MobiControl and to the scripts but having read the reference guide I don't think I'm making any rookie mistake, but please enlighten me!

I'm trying to find out when a device (Samsung A6- SM-A600FN) is turned off and on, one rough way of doing this seems to be checking when a device gets switched to "User mode" (seems to always occur when a phone boots). There doesn't seem to be a built in way of alerting for this, so I thought maybe scripts would be a good place to start and then see if I can send an email alert or report from there. I can see the event in the log already but ideally I need some alert for this, as any occasion this occurs during the working day would be suspicious for us.

Following the reference guide HERE and using the example code below return "%var1%" not "Hello World" as expected.

set var1=Substring "Hi Hello World Goodbye" 4 11

showmessagebox %var1%

Any advice would be much appreciated.

6 years ago
Android
ANSWERS
RC
Raymond Chan Diamond Contributor
6 years ago

The 'set' script command and environment variables for Android devices only work in Command shell tool in classical non-html5 remote control.  So, your failed result is expected.  

SW
Sam Walker
6 years ago

Thanks for your reply. I'm presuming you can still run scripts in the current version and the help guide is just out of date, if so, can you let me know where I can find some up to date literature or help with this issue?

RC
Raymond Chan Diamond Contributor
6 years ago

Your URL to the on-line manual is already the most up-to-date.   However, there are inaccuracies in the documents.

SW
Sam Walker
6 years ago

Sorry for my ignorance, are you saying there is no longer a way to set environmental variables and therefore the scripts are a bit useless, or just that there's no up to date documentation on the new syntax? If it's similar/same syntax to another programming language please let me know and I will refer to that.

The script console does send messages to the phone, just no access to variables, so at some level it still works.