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.

Check if file is closed before importing from another database

Featured Replies

Greetings!

 

I have what I hope is a very easy problem to solve. I have a runtime that imports data from another runtime file. Everything works fine as long as the other file is closed. I have had users who have run the import while the other file is open and the script completes but obviously nothing gets imported because the other file is currently locked. Before running the import script, I would like to test to see if the other file is closed. Is there an easy way to do this? Some calculation that I can test against? etc.

 

Any thoughts would be helpful!!

 

Thanks!

 

Stephen

Are you talking about two different runtime applications?

  • Author

Yes, they are two different runtime applications.

I haven't used runtimes in ages. If it really works they way you describe (and it makes sense that's how it would behave), then there's not much you can do within Filemaker itself. However, you could use AppleScript to check if the other application is running and/or quit it.

  • Author

In my current import scripts, they will run normally but just won't import any data. I'm trying to catch this before it runs the import so I can give a warning. I am not too versed in Applescript though I have used it somewhat. I'd be open to doing that. Any ideas?

[croak ... layers of rust cracking ... groan]

 

Well, normally you would test for application's running status as:

tell application "System Events" to set appStatus to exists (processes where name is "YourAppName")

However, I have just now tested this with a runtime, and it seems that the name of the process of every runtime is "Runtime" - so try testing the bundle identifier instead. Here's the entire AppleScript as you would use it in Filemaker:

tell application "System Events" to set appStatus to exists (processes where bundle identifier is "com.filemaker.client.runtime.MyRuntime")
set cell "gRegister" to appStatus

where "MyRuntime" is the name of the runtime application you want to check, and gRegister is a global field to receive the result (and it must be on the current layout).

 

 

Caveat: I haven't really tested this with two runtimes.

  • 2 weeks later...
  • Author

I also found that error code 803 would trigger when trying to import records from a runtime that is open. So in the end I was able to capture this error and proceed accordingly. In other parts of the program, I do use AppleScript and it has worked well thus far. Thanks again!

I also found that error code 803 would trigger when trying to import records from a runtime that is open. So in the end I was able to capture this error and proceed accordingly.

 

Ha! Good for you! And thank you, this is a good lesson for me: I should have thought of this, runtime or no runtime.   :doah:

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.