Have you tried turning the error capture on and then testing to see if an error is returned when you try to open the url?
Set Error Capture [On]
Open URL [www....]
If [Get ( LastError ) > 0]
Show Custom Dialogue ["Warning"; "Please install the app!"]
I've done exaclty the same. I Also used a global variable to show the error but no error is displayed
Hmmm not sure if this will work or not, but I would try putting a web viewer on your layout and populate it with the URL you are trying to open.
Then see what the web viewer shows on the iPad/iPhone, hopefully some sort of error message is displayed in which case you should be able to use the GetLayOutObjectAttribute script step to look for that error message text and then display a warning to the user if it is found?
If the error text is not found in your web viewer then procede with the Open URL command.
1 of 1 people found this helpful
As Paul said, using "Set Error Capture [On]" should supress FileMaker's error dialog (but I haven't tested this myself). If you're using "Open URL" to launch another iOS app, then, if sucessful, the script should halt immediately after the Open URL step, since FileMaker Go scripts don't support multi-tasking. You should be able to safely assume that, if the script continues executing at all after the "Open URL" step, it didn't work:
Set Error Capture [On]
Open URL [appscheme:...]
# Assume that anything executed after this point is because of an error
Show Custom Dialog ["The operation could not be completed. Please install <app name here>."]
The open url in iOS opens a Windows to show the web page or, such as in this case, the error.
So it appears that the open url returns no error but the error is returned in the web page that has opened...
So using a web viewer and passing it's result should be a good idea: i'll do a try
Unfortunately WV doesn't understand that URL....
jbante ha scritto:
then, if sucessful, the script should halt immediately after the Open URL step, since FileMaker Go scripts don't support multi-tasking. You should be able to safely assume that, if the script continues executing at all after the "Open URL" step, it didn't work:
Well. You're almost right...
But the window with the "web error" (that I attach) opens and the user has to close it; after closing it appears my dialog wth the error and, with another "open url", I'll send the user directly in the AppStore....
Thats a shame!
Does the content of the WV change at all if the app is or isn't installed on the device?