Start Filemaker 7, open dbase, enter password and account number

Hello. I am SO happy to have found this forum. I know very little about Applescript, but wrote a script in the past to successfully open Filemaker 5.5 files and put in the password. We’ve migrated to Filemaker 7, and of course my script doesn’t work any more . I found this in the library:

open: Open an object
open reference – The object to open
[with passwords string] – The password to use
[for Accounts string] – The account name

But I’m afraid I don’t understand how to modify it for my use.

I think I want it something like this:
tell application “Filemaker Pro”
activate
tell application “Filemaker Pro”
open (choose file)
[with password “donottell”]
[for Accounts “Admin”]
end tell
end tell

but it won’t compile, and I get this error message:
Expected expression, etc. but found “with”.

I appreciate any help/advice you can offer! thanks very much!
Sally

Hello, I’m new too, but I think I might be able to answer your queston

tell application “Filemaker Pro”
activate
set the_file to choose file with prompt “Choose a file…”
open the_file with properties {password:“donottell”, accounts:“Admin”}
end tell

let me know if it doesn’t work or what it does do.

sling :slight_smile:

When you browse a dictionary, [things enclosed in brackets] are “optional parameters” (you can specify them if needed, otherwise ignore them). Bold keywords are the “parameter name”, and plain ones, the input these commands are waiting for. And, finally, a description about the parameters. You write the entire command in a single line. So:

set theFile to choose file
tell application "FileMaker Pro"
	open theFile for Accounts "Account Name" with passwords "The Password"
end tell

Thanks, JJ.
When I compile the script you gave me, I get this error message:
“expected end of line but found identifier.”
and the word for is highlighted.

Any suggestions?
thanks!
Sally

Works fine with my copy of FM 7.0v3, OS X 10.4.3… What’s your configuration?

Hi,
10.3.9, 7.0v3…Applescript is AppleScript 1.9.3, script editor 2.0 (v43.1).
Sally

What if you type it manually?

Thanks for the continued help. When I type it manually, I still get the same error when I try to compile the script. If I write the script just to tell Filemaker to open (choose file), that all works perfectly. The account name & password dialog comes up with the account name already in the dialog (because it’s the same as the custom name I have in filemaker preferences), so the cursor is already in the passwords field. Is there maybe a way just to tell Applescript to enter text to that field instead of the “open with passwords” statement?

thanks!
Sally

You’re being bitten by the fact that AppleScript is still looking to FileMaker 5.5 when you say:
tell application “FileMaker Pro”
And 5.5 doesn’t have plural “passwords” or any “Accounts”

It’s difficult to force it to use 7, especially if 7 is not running. If you try your script with 7 running, but not 5.5, you’ll see that it works. If not, write a new AppleScript while only 7 is running and save it as a droplet.