Re: More FMP8 Questions
Re: More FMP8 Questions
- Subject: Re: More FMP8 Questions
- From: Chris Prew <email@hidden>
- Date: Thu, 25 Jan 2007 14:01:52 -0600
OK, this is getting strange.
The code Tim sent me below works (thanks!), but its having problems
-- I think its more with the data type than with Filemaker. So:
If I run the below as is, and there is a record to be found, the
result I get is a list of the characters of the InvoiceID as a
character -- so if the found set is InvoiceID 100, I get a list of
{"1","0","0"} -- so three items that are incorrect. However, if the
found set is has no records, I get an empty list and this works fine.
So I tried changing it to:
set my_list to cell "InvoiceID" of (every record of table "Invoices"
whose cell "Status" is equal to "Open") as list
And then it works fine if there are records to be found -- but if
the found set is empty, it tells me there is one item in my list, and
when I try to return or display what this mysterious single item is
(as a string, or not as a string), I get an "Event not handled"
error. I _think_ the single item in the list is the class of "(every
record of table "Invoices" whose cell "Status" is equal to "Open")"
which apparently doesn't parse to a string very well...
Any suggestions anybody?
TIA
Chris
On Jan 24, 2007, at 4:21 PM, Tim Mansour wrote:
Try this:
tell application "FileMaker Pro"
open document "path:to:myapp"
show layout "Invoice"
try
set my_list to cell "InvoiceID" of (every record of table
"Invoices" whose cell "Status" is equal to "Open")
on error
set my_list to {}
end try
end tell
Note that you'll need to insert the correct table name: I've
assumed "Invoices". Also, if there are no records with
Status="Open" then FileMaker will error, so you need to trap for that.
--
_______________________________________________
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