Page 1 of 1

Pause a script while the mobile OS shows an alert

Posted: Mon Apr 11, 2022 10:38 am
by trevix
I have a LC script such as:

Code: Select all

...put false into sWiFiConnected
...put WifiConnectToNetwork(pArray["SSDI"], pArray["Password"]) into sWiFiConnected --become true if WiFi is paired
repeat with U = 1 to 15
          if sWiFiConnected AND "192." is in the networkInterfaces then
               exit repeat
          end if
          wait 1 seconds with messages
end repeat
I have noticed that, if the mobile OS shows an alert (in my case...do you want to connect to this WiFi...) while the script is doing the loop, the LC script keep running anyway in the background.
This is making very difficult to time the user interaction. If he waits too long to press "OK", the loop will go to the end with sWiFiConnected = false.
But the pairing to wifi has been done.
Is there any way to pause a script while the OS is showing an alert?