Speaking to a Filemaker Database

In OSX I have a script (carried over from OS 9) In which I want to tell a specific Filemaker Database, of several that are open, to do a script function.

This works if the Filemaker application is already running. If it is not, a dialog box to “Open File” hangs up the script. (Even after the File “INVOICES” is already open)

tell application “Finder”
open “Macintosh HD:Applications (Mac OS 9):FileMaker Pro 5 Folder:Business:INVOICES”
end tell
tell application “FileMaker Pro”
tell document “INVOICES”
Do Script “New Record”
end tell
end tell

How do I get the script to launch Filemake and address the INVOICES database without getting the “Open File” dialog?

This works in OS 9 but not in OS X.

You can try the following :

tell application "FileMaker Pro" 
open "Macintosh HD:Applications (Mac OS 9):FileMaker Pro 5 Folder:Business:INVOICES" 
--the script yo want to accomplish
end tell 

On my OS X system, the following code works and doesn’t produce a dialog. Excluding the launch step doesn’t appear to make a difference for me but it is normally used to launch an application while preventing it from going through its normal initialization routine (dialogs, new windows, etc.).

tell application "FileMaker Pro"
	open alias "Macintosh HD:Applications (Mac OS 9):FileMaker Pro 5 Folder:Business:INVOICES"
end tell

Is there a specific reason why you use Finder to open the file?

I thought the finder was required to do this. How else to you speak directly to a file or database? I cannot find documentation that is consistant on usage of the language and the proper format to write scripts. I just keep trying until I get one that works. It’s frustrating. Thank you for your help.


There are times when it’s more convenient to open a file through the Finder. I just wanted to determine if your script required it. :slight_smile:

When FileMaker is installed from the CD, the default installation usually includes documentation and sample scripts, or it at least provides the option to install them. If they were not installed on your computer, it might benefit you to investigate the CD. The examples might prove to be very valuable to you. :slight_smile: