Jump 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.

Determine if another file is opened

Featured Replies

I am creating a script to Close a file.

I originally set the button to Exit the Application, but found in the instance that a use had more than one file opened, they were all closed.

Is there a way to say :

IF(.fp7 Files Opened =1;Exit Application Else Close Current File Only

?

  • Author

This SEEMS to work:

IF(DatabaseName<>"DB01";Close File);

Else

Exit Application

End IF

How about :


If [ DatabaseNames = Get ( FileName ) ]

Exit Application

Else

Close File [ Current File ]

End If




or:





If [ ValueCount ( DatabaseNames ) > 1 ]

Close File [ Current File ]

Else

Exit Application

End If

This way you can rename your file without breaking the script.

  • Author

Perfect.

Thanks...

I will use the first script based on the file name opened.

May I suggest you NOT exit the application. You are assuming that your solution is the only one the user has open.

I find nothing more frustrating than closing a database, only to find it quits FMP and all the other databases I had open.

  • Author

The whole principle i want is to Exit the Application, but IF another file on the users PC i opened, then only to Close the current file to not cause that frustration.

Create an account or sign in to comment

Important Information

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

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.