Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi All

FMU on OS X tends to crash (apparently this is well known, I've only just found out!!)

Apart from using OS 9 can I use an applescript to check whether FMU has indeed crashed and then open FMU with some predetermined Databases?

I do not know applescript so would appreciate some help/pointers

I anticipate using the script with cronniX to run the script at pre-set intervals.

anyone?

TIA

Matt

Posted

I'm not exactly an Applescript guru, but something like this might do it:

tell application "Finder"

set CrashDate to the modification date of file "HD:Users:you:Library:Logs:CrashReporter:FileMaker Pro.crash.log"

set FileDate to the modification date of file "HD:Users:you:YourDatabases:YourFile.fp5"

if CrashDate = FileDate then

Open etc...

end if

end tell

Posted

Interesting approach... can you be sure they will have the same modification dates, down to the second?

An alternative approach is to use something like...

tell application "Finder"

if (name of processes) does not contain "FileMaker Pro" then

...

end if

end tell

I have not done enough scripting with OS X to know how this will work with a crashed application. My guess is that the process list is might not reflect any change after the application crashes.

A better aproach could be to use a simple activate within an error trap.

Try

Tell app "FileMaker Pro" to activate

on error

...

end try

[You might need to set the timeout to something larger than the default (60 sec.)]

Posted

My thinking was that it's not important to know to the second the time of crash, but rather that a crash recently occurred. But I see your point, if the post-crash procedure had already been run for the day, you would also want to test for that, and flag it somehow.

Also, not to confuse the issue, but my guess would be the opposite, that the process list would update after a crash. Not sure. So I'd guess your first script would work.

However, your second script I think won't work, i.e. it wouldn't generate an error. Even if the app crashed, telling it to activate will simply launch it.

Maybe instead of using AS, you could just launch a particular file at a given time. This file would have a startup script that would do something like:

If (Position(DatabaseNames, "ImportantDatabase", 1, 1))

.. ## the file is open, so it has not crashed

.. Close ()

Else

.. ## do whatever

End If

Posted

Hi all

Thanks for your replies, much appreciated

I also sent the request to the FMWebTalk list. One reply from Marisa Smith went like this...

---

Here's the Apple Script I have been using successfully for a few months on OS X.2:

on idle

with timeout of 360 seconds

tell application "FileMaker Pro"

activate

if (database "Newsclips.fp5" exists) is not true then

activate

open file "Path:To:Shell:Database.fp5"

end if

end tell

tell application "FileMaker Pro"

activate

end tell

end timeout

end idle

Be sure to save it as an Application and check "Stay Open" when you save it.

This script basically checks every few seconds to see if the main database needed for my web solution is open, and if not, opens up my "shell" database file, which is just a Filemaker file with no records or fields-- just a startup script that opens the appropriate database files on my Filemaker Server, then brings FMPro to the front.

The only thing about this script is that you need to disable/quit out of it it if you want to intentionally close the database files in order to do server maintenance.

---

It looks like a winner to me, but what is the verdict from the Applescripters here...??

Posted

That's the same idea as my last post, except mine does the "does it exist?" test using a FileMaker script in the "shell" file rather than in AS. Whatever works.

Posted

The step...

open file "Path:To:Shell:Database.fp5"

will not work if the file is hosted on a server. In that event, you could use an opener file and issue a scripted open.

  • 4 months later...
Posted

bringing this back up, i'm trying to get the last ideas posed to work on a 10.1.5 server. i'd just assume not have to downgrade to OS 10 client but i will if i have to.

does anyone know of any particular issued i have to work around for 10.1.5 server? i'm no applescript guru but i can make my way around.

TIA!

Posted

Wow, didn't know I was still tracking this thread!!

Can you tell us what your setup is, what isn't working, and what errors (if any) that you are getting?

The server referenced in the last post would have been Filemaker Server. The 'Opener' database is used to automate opening the required database/s from the Filemaker server using the in built Filemaker 'Scriptmaker' as Applescript on it's own would not be able to find the databases in order to open them...

Without having tried it, I would not expect OS X server to have any issues with this approach.

But you can tell me different...

Posted

i have a shell database that contains the open scripts for the databases on the server.

FMU 5.5 running on MacOS 10.1.5 Server on an XServe

the error i get when the script is running and my file "Startup.fp5" is:"the Event failed"

when prompted to edit the script, it goes to this line:

open file "/Users/admin/Desktop/startup.fp5"

i've used a few variations on the UNIX path, relative and absolute, but to no avail

thanks for any help! FMU crashes at least once a day.

Posted

This is my Applescript...


on idle

	with timeout of 360 seconds

		

		tell application "FileMaker Pro"

			activate

			if (database "ARTDIARY.fp5" exists) is not true or (database "ARTBOOKS.fp5" exists) is not true or (database "Web Security.fp5" exists) is not true then

				activate

				open file "Users:admin:Documents:FMCheck:Opener.fp5"

			end if

			

		end tell

		tell application "FileMaker Pro"

			activate

		end tell

		

	end timeout

end idle

The method of describing the path is 'oldskool' OS 9 but seems to work. I have had this running on OS 10.2 with FMU 6 for a few months now with no issues...

Hope it helps

Matt

Posted

ok maybe that's the issue. Applescript probably isn't UNIX-savvy...

tahnks for th advice! i'll let you know if it works

EDIT

well it seems that the old school notation worked! i did have to put the volume name int here before the "Users" but all is working now!

thanks for all the help!

  • 5 months later...
Posted

My situation is slightly different so I don't know if the above posts would apply. My FMU 6 (with all of the updates installed) never actually quits when it crashes, it only hangs the app with the spinning beach ball. Manually, it requires a Force Quit of the program and then re-opening the databases (for which I have an opener file). Does AppleScript have a "Force Quit" command? Can it determine whether an application is responding if it hasn't technically crashed?

At this point I think I'm just waiting for version 7 server (which includes the Web/Unlimited component) to come out because it's crashing about once a day, usually during low-traffic periods, although the number of records in the databases seem to affect it as well, because it didn't used to be as much of a problem.

Posted

I think you want to look into sophisticated circuits product kick-off at http://www.sophisticated.com/

You set kick-off up to monitor your application, and if it is not responding -- due to system crash or application crash -- the hardware will restart your computer. [Of course then you will need to have FMU set-up to automatically launch on start-up.]

  • 4 weeks later...
  • Newbies
Posted

Thanks for all the great postings to this thread. It has been very helpful to me in validating I am not alone with this problem, and I got a nice applescript too. Unfortunately, I still have many crashes or quits under both 9 or X. Sadly, after implementing the script today I had a number of crashes, two of which the relaunch failed (no system hang) with different messages. The first was a damaged db that failed to open and needed recovery. Later it was "service not available" that stopped the script. Any ideas on triggering a forced restart and/or selecting a backup copy of the db to open would be way cool. Does the problem go away under WinXP?

Any thoughts are very appreciated.

This topic is 7472 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.