Insert records into a remote Filemaker DB

All,

I want to connect to a remote Filemaker DB using AppleScript and insert records into a table. I have a similar local DB on my machine and I’m able to insert records using AppleScript easily. Here is the AppleScript I’m using to insert records into my local DB:


tell application "FileMaker Pro Advanced"
                       tell database "Test"
                            set theRecord to create new record at table "employee"
                            tell theRecord
                                set cell "fname" to "Test"
                                set cell "lname" to "Test"
                                set cell "age" to 25
                                set cell "email" to  "test@test.com"
                            end tell    
                        end tell    

end tell 

I have the same DB structure on a remote machine whose IP address I know. I’m trying the following piece of code:

tell application "FileMaker Pro Advanced"
	with timeout of 300 seconds
		getURL "FMP12://SomeIPNumber/Test.fmp12"
		tell database "Test"
			set theRecord to create new record at table "employee"
			tell theRecord
				set cell "fname" to "Test"
				set cell "lname" to "Test"
				set cell "age" to 25
				set cell "email" to "test@test.com"
				
			end tell
		end tell
	end timeout
end tell

But I keep getting the following error:

error “FileMaker Pro Advanced got an error: The event failed.” number -10000

Do you need to have the getURL in there? that’s the IP of the db right? Why not just have it opened before hand? Seems like an easy place to have an error. Maybe the db is requesting a login/pass when you open it?
Also, in FM11 there is a bug when passing off some Applescript commands. They happen asyncronously (out of order) and don’t return replies, not synchronously (in order) so you might need to add some “delay” or “do shell script sleep 1” steps.