Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Opening Script

Featured Replies

Hello All,

I am in the habit of creating a small database file with no fields and 1 script with the goal of opening a hosted solution. The script is simple:

ToggleWindow (Hide)

Open (database.fp5 xxx.xxx.xxx.xxx)

Close (opening database)

Set this script to run at opening.

This seems to work well, for a time...

I can't seem to figure out what causes the file to fail. When it does fail, opening the script results only in the application opening and a brief attempt to locate the hosted database.

Its a catch-22, because as soon as this file stops working, you can't troubleshoot it because the script runs at start up and when it fails to open the hosted database the opening database closes.

The only clue I have towards solving this dilema is that it seems to begin when the hosted database is unavailable for whatever reason.

Any thoughts or recommendations are greatly appreciated.

Randy

"...you can't troubleshoot it because the script runs at start up and when it fails to open the hosted database the opening database closes."

But perhaps you can troubleshoot it.

ToggleWindow (Hide)

Open (database.fp5 xxx.xxx.xxx.xxx)

Pause/Resume Script []

*Comment, Insert to troubleshoot and then remember to remove this line.

Close (opening database)

If you turn error handling on at the start of the script then you should be able to make a conditional decision immediately after attempt to open.

First of all, to troubleshoot, I suggest you give yourself a 'backdoor'. Two ways of doing this are:

1. Place additional steps at the beginning of the start-up script as follows:

If ["Status(CurrentModifierKeys) = 1"]

Exit Script

EndIf


That way, if you hold the shift key down as the file is launched, the start-up script will exit before it closes the file.

or

2. Add a single step dummy script (eg Go to Layout[ ]) in the file which you can call as an external script from within another file. When a file is opened indirectly in this way, its start-up script doesn't run.

Numerous variations on the above themes should get you a back-door that lets you crack into the file to troubleshoot.

Now on to your underlying problem...

It seems from your description that the problem may stem from a broken path. That is, when the file which is to be opened is not available, FileMaker is updating its reference to the file - in this case to <file missing> and this null parameter is being saved with the file when the script closes it.

I suggest that you explore alternative ways to open the file. Currently you are using the 'Open [ ]' script step. Try using a 'Perform Script' step which points to the start-up script in your main solution file(s) or a 'Set Field' step which sources or targets a field in the main solution file. You will find that these alternative methods are just as effective in opening the desired file(s), but have different characteristics, both in regard to the state in which the target file is opened (eg hidden/minimized or not, whether the start-up script is invoked etc) and also the way in which broken paths are handled on different platforms.

Once you have got a back-door for troubleshooting, I'm confident you'll find a combination of steps which will ensure that your open file continues to function even should the path be broken.

If you have error capture on you can trap for error 100 missing file.

If ["Status(Currenterror) = 100"]

ShowMessage (The serve must be down....... Contact techsupport)

QuitApplication.

EndIf

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.