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

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

Recommended Posts

Posted

I am trying to upload a database to a web server via Fetch 4.0.3.

Filemaker 6 is initiating the applescript from a Filemaker script.

Everything works well, until an error appears. Fetch begins the upload, and in exactly 2 minutes Filemaker posts this error:

Fetch 4.0.3 got an error: AppleEvent timed out. (Error -1712).

Fetch is, in fact, still uploading, but my Filemaker script continues to the next step, sending an email telling the host to swap out the database. But it's not fully uploaded yet! So, I need some way to supress the error, or set a timeout somewhere longer.

Here is my code (I made the delay long to see if there is a change. Result: no change!):

tell application "Fetch 4.0.3"

activate

with timeout of 2300 seconds

open remote directory "ftp://myserver.com"

put into transfer window "filename and path" format Automatic without uniquename

end timeout

quit

end tell

It works fine when run from the Script Editor, just not from FM6.

Any ideas???

Thanks!

Posted

I just solved my problem - it is a bug in filemaker that has been there for years! The FM Script work around looks like this for me:

I created the script as an application file on the hard drive.

Send Apple Event -> Open Application -> UploadDatabase.app

Pause [20 minutes]

Send email to swap the database

The file takes 17 minutes to upload now, so I gave it a little more for the future.

Works fine, but now I have to manage the extra file!

Here's a post that helped me discover this:

http://fmforums.com/forum/showtopic.php?tid/79628/

Hope this helps the next guy who stumbles on this problem!

Posted

Send Apple Event -> Open Application -> UploadDatabase.app

Pause [20 minutes]

Send email to swap the database

The file takes 17 minutes to upload now, so I gave it a little more for the future.

To make this more dynamic, you could split the script in two. The email would be in another script and the last line of the first script would call the app. When the app is done uploading it can then call the email script in FM. This way you don't have to hard code a wait in FM and hope it is enough.

This approach has the added benefit that if the app has an error, it could call another script in FM to send out another email...

  • 2 weeks later...
  • Newbies
Posted

I don't know if this is a better way but I think it is the most flexible. Just before every "Perform Applescript" step in a FileMaker script, I set a global field that I always call "g_AS_Done" to 0

The last thing that every Applescript does is set the value of "g_AS_Done" to 1. Then my FileMaker script loops until "g_AS_Done" is 1 or a loop counter hits some terribly high integer meaning something bad happened in the Applescript. FileMaker does not wait for the result of your Applescript.

If you can use a UNIX shell script there is another option. There is a FileMaker plugin/extension called "Shell" by Abstrakt. It is free and you can execute shell commands directly from FileMaker and the result is returned to your FileMaker database. I love it and it is much more reliable. I have even gone so far as to have a shell command that calls an Applescript.

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