Jump to content
Server Maintenance This Week. ×

Opening Script


This topic is 7922 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

"...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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 7922 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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