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.

Shutdown scripts

Featured Replies

I have developed a system comprising 6 files in FMP5.5v2. The user starts off by a shortcut to the main file, which opens up all the others, initializes variables etc. When shutting down, I include a ShutDown Script with the main file, which closes the other 5 files (by calling 5 times the external ShutDown Script in each of them) before closing itself. In the 5 files, the ShutDown script is a simple Close[mainfile] command.

Problem is, the system doesn't work. mad.gif It behaves erratically, leaving some of the files open when you would expect to only be left with the application window but no file open. Some of the 6 files are related - would that be a problem?

Thanks for any help. smile.gif

Yes, the relationship are the problem. You can call the 'Exit Application' script step from your main pgm to close the solution

  • Author

Thanks, Steve.

However, exiting the app isn't the most elegant way of doing things, especially when you have to wait for it to open again in a few seconds to open a different system.

Surely there has to be a way to shut down a multiple file system with relationships by clicking in one place!??

When shutting down, I include a ShutDown Script with the main file, which closes the other 5 files (by calling 5 times the external ShutDown Script in each of them) before closing itself. In the 5 files, the ShutDown script is a simple Close[mainfile] command.

I'm no expert here, but if I understand things right, it would be erratic. The Close calls the ShutDown... the ShutDown calls the Close... and so on. ShutDown is for commands you want it to run right before it closes the file... it shouldn't close the file.

Try having your main file simply close the other five... those closes will call the ShutDowns in those files... which it sounds like for the moment will be empty.

Just my 2 pennies worth... one of the forum gurus may set us both straight.

  • Author

I understand what you mean, a sort a recurring cycle of close-call script-close-etc...

I have come across systems, however, which do similar things. In "Using FileMaker Pro 5" by Richard Coulombre of The Support Group, for instance, in the sample systems on the CD accompanying the book, there is an Invoicing system made of 6-7 files, with relationships, and each file has a typical ShutDown script which is a sequence of Close [filename]'s. Each file is scripted, upon closing, to first close all the others.

So my question is: how come THAT system doesn't face the same problem?

Thanks,

Alex.

The reason the files close then open again is as said, because of relationships. To get around this, simply switch layouts. What I would recommend is a so-called farewell screen, saying goodbye to the user. Thus, there are no related fields or portals on the layout to trigger the files again. This will do it!

  • Author

laugh.gif Man, Rigsby, thanks a lot!!!!!!!!!!!!

It's so simple, I should have thought about it! Thanks, man!

BTW, since it's six files, and most of them connected through relationships, would this mean that I should script in each of the files' ShutDown scripts to change to a 'neutral' layout in EACH of the files, and then proceed with closing? If yes, would there be a way to make the screen keep calm while this change-change-change takes place? (perhaps FreezeWindow or something? I don't really know how this command behaves...)

Thanks again.

It is not that difficult, just try that. Personally I am trying several ways to solve one problem.

You can for example show closing screen from main file, and then minimize the files which you want to close.

Yes, I just use the Close[] step to close other files in my systems. Works eveytime.

Scripting the ShutDown scripts is fine, but most users would try and close a file from the Close File command or the close file symbol ("x" in windows, or the square(?) thingy on a Mac), wouldn't they? I can't find a way to prevent them from doing this.

Take a look at the SecureFM plug-in at www.newmillennium.com. This plug-in allow you to disable Quit/Close and a host of other menu option.

-bd

You could set the shutdown script of those files to be the files own open script. That is, when the user closes a file manually, it automatically calls the file's open script, essentially keeping it open until another file sends the "real" close command.

Thanks for these suggestions. I'll experiment a bit!

I just post the topic "Quit Filemaker", then found out the similiar topic is already posted here.

Anyway I just tried the idea from Peter (The_Bridge), I ran into a infinity loop, what it does is that it open files, then close files, then open files, and on and on. Finally I had to click on the x located at the top right corner of FMP Winodws to shut down FMP.

It is not work or I missed something here.

LiveOak,

Do we have to have the Plug in to prevent user from closing the FMP by click x, or File>Exit?

I think you might have to have a script in an external database to close down your current file.

I currently don't utilize any shutdown scripts, but I have a Close button that asks if they want to close just the one file or all. If they choose "All", it runs a "Close All" script I have in Admin.fp5, which obviously closes all files, including the Admin.fp5 file (last).

For now, I just encourage users to use the Close button on my layout, not the regular close button.

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.