January 28, 201510 yr 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
January 29, 201510 yr 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.
January 29, 201510 yr 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?
January 29, 201510 yr [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.
February 9, 201510 yr 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!
February 9, 201510 yr 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.
Create an account or sign in to comment