MACSCRPT Archives

June 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Bruce Robertson <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 11 Jun 2008 14:43:06 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
> This ought to be the most basic, simple thing you could possibly do,
> so I'm probably missing something obvious.  I want to get the value
> of a particular cell from a record that matches something in another
> cell.
> 
> In SQL, something like
> select phone_number  from people where name = "Smith"
> 
> so why not
> 
> tell database "people"
> get cell "phone_number of every record whose cell "name" is "Smith"
> end tell
> 
> -->Object not found
> 
> Tried get data, show, find, goto, and so on. Always an error.
> 
> Every reference on Applescripting Filemaker I've looked at has
> offered vast detail on how to get field names, table descriptions,
> yadda yadda.  Not a word about just finding data.
> -- 
> 
> Bill Steele
> [log in to unmask]


If you are referencing a layout, fields must be on it.
If you want to display the data you will need to target the correct layout
and maybe even window. Since a Filemaker file can now have many tables you
will often do best by being quite specific.

To do a query like you describe, you would need a table reference. A table
is the underlying data structure and has no found set or sort order.

tell application "FileMaker Pro Advanced"
    tell table "Contacts"
        cell "Phone" of (every record whose cell "Last name" = "Smith")
    end tell
end tell

ATOM RSS1 RSS2