AnsweredAssumed Answered

Applescript getURL does not wait until the database is open to return a result

Question asked by nalf on Sep 29, 2010
Latest reply on Oct 7, 2010 by TSGal

Summary

Applescript getURL does not wait until the database is open to return a result

Product

FileMaker Pro

Version

FileMaker Pro Advanced 11.0v2

Operating system version

10.6.4

Description of the issue

getURL does not wait to return a result, therefore any code after this can fail.

Steps to reproduce the problem

tell application "FileMaker Pro Advanced"
     launch
     getURL "FMP7://username:password@serverIpOrDns/databseName"
     return (name of window 1) --fails sometimes because the database window is sometimes not shown, because the database in not open yet. (long opening times, slow servers, scripts that run on database open, etc... (sometimes more apparent when the application is not running before opening a database via getURL)
end tell

Expected result

getURL should return a reference to the database opened, or at the very least true or false as to if the database is open and accessible. In the above example, if the database cannot be opened, the getURL line should return the error, not the next line.

Actual result

getURL return nothing immediately, and the database cannot be communicated with

Workaround

loop handlers sub-routines and delays help, but it's still tricky at best.

Outcomes