Re: FileMaker 8 "create new record" again....
Re: FileMaker 8 "create new record" again....
- Subject: Re: FileMaker 8 "create new record" again....
- From: David Crowe <email@hidden>
- Date: Tue, 14 Nov 2006 06:10:40 -0500
Title: Re: FileMaker 8 "create new record"
again....
Malcolm;
Yes. FMP uses context to deduce a huge
amount of information. It will always use the current layout (which
has an implicit table) unless you specify a location using "at" or
"in". You'll find this information in the Apple Events Reference
database which is amongst the materials in the FMP application
folder.
Is this for your Address Book synching database?
malcolm
You're correct that I'm trying to migrate my Address Book
synching database (part of a bigger application).
I have consulted the Apple Events Reference database and I don't
find it clear at all. Their examples seem to rely extensively on
defaults which make it difficult to know which objects really are
involved. Besides they mostly refer to objects by number instead of by
name. I have yet to find a clear example of what should be a very
standard operation with a database:
get <list of cells> from <table/database etc.> whose
<list of 'cell=value'>
I have derived from this reference that if you want to access
data independently of the user interface you need to use
"database" instead of "document" and "table"
instead of "layout".
For example, the reference manual for "Cell" has the
following code as an example:
tell application "FileMaker Pro"
-- omitting several examples
show (records whose cell "Name" is
"Jones")
end tell
Very nice, but what the heck are the defaults in the case? Which
document/database/cell/layout/window/table combination is being
inferred?
I have tried almost identical code and it works ... but ONLY if
the database/document/layout/table is frontmost. Of course, you say,
that's because no objects are specified, they are all defaulted. But
even when I specify the database+table or document+window+layout I
either get the errors event not handled or object not found.
For example, I have tried the following:
tell application "FileMaker Pro Advanced" to tell database "Meeting Tracker" to tell table "Contacts for AppleScript"
cell
"name" of
every
record
whose cell "last name" is "Crowe"
end
tell
And I get "Object not found" (even though there are
records with the field "last Name" set to "Crowe".
I have also tried access via the document/layout (and I can throw in a
window object too, to handle the situation where the same layout is
opened by multiple windows)...
tell application "FileMaker Pro Advanced" to tell document "Meeting Tracker" to tell window "Meeting Tracker" to tell layout "Contacts for AppleScript"
cell
"last name" of
first
record
whose cell "last name" =
"Crowe"
end
tell
And I get the same error. However, if I remove the "whose"
clause it works as I would expect.
I have not yet been able to get any combination of objects to
accept a whose clause based on the value of a cell except when
everything is left to defaults. Even replacing the <=
"Crowe"> by < ""> generates the same
error. Ditto replacing it with the tautology "1=1".
I have spent far too long experimenting (and reading the apple
events database descriptions) but still am running into this road
block. Obviously it's difficult to find the FileMaker record
associated with an AddressBook record without the 'whose'
clause.
- David Crowe
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden