MACSCRPT Archives

October 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:
Chuck Pelto <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 14 Oct 2008 14:12:23 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (133 lines)
I have discovered the nature of my malfunction.....

I should NOT be using xCount in the call....

>> set cell cellName of request xCount to cellData


It should be the count of the request, which in this instance is ONLY  
going to be 1.

Regards,

Chuck

On Oct 14, 2008, at 2:02 PM, Bruce Robertson wrote:

> Your script works correcty as written, so it is unclear what you  
> are trying
> to do.
>
> Given this:
> set dataList to {{"State", "WA"}, {"State", "WY"}}
>
> I find all records where State = WA and all records where state = WY.
> In my case, 717 WA + 197 WY = 914 found.
>
> What does your dataList look like and what are you trying to do?
>
>
> Also, what is this supposed to do? What it actually does is get the  
> total
> record count, not found count.
>
> set recCount to (count of records in current table)
>
>
>> So I've discovered that show every record whose cell....doesn't work
>> all that well in the new FMP9a AppleScripting Events.
>>
>> They've got something called "Find" and the syntax is as follows:
>>
>> tell application "FileMaker Pro Advanced"
>>
>> try
>> delete every request
>> end try
>>
>>
>> try
>>
>> create request
>> set cell cellName of request 1 to cellData
>> find
>>
>> on error errMsg number errNum
>>
>> set theError to errMsg
>>
>> set recID to 0
>>
>> end try
>>
>> So what do you do when you want to search on multiple criteria? As in
>> two fields with two datum?
>>
>> I tried THIS...
>>
>> tell application "FileMaker Pro Advanced"
>>
>> try
>> delete every request
>> end try
>>
>>
>> -- find the record we want to update
>>
>> set xCount to 1
>>
>> repeat until dataList is equal to {}
>>
>> set thisData to item 1 of dataList
>> set dataList to rest of dataList
>>
>> set cellName to item 1 of thisData
>> set cellData to item 2 of thisData
>>
>> try
>>
>> create request
>> set cell cellName of request xCount to cellData
>> find
>>
>> on error errMsg number errNum
>>
>> set theError to errMsg
>>
>> set recID to 0
>>
>> end try
>>
>> set xCount to (xCount + 1)
>>
>> end repeat
>>
>> set recID to cell "RecordID" of current record
>>
>> set recCount to (count of records in current table)
>>
>> end tell
>>
>> It doesn't work.
>>
>> Instead of finding the one record I'm looking to find, it finds
>> multiple records with the data from the last request only.
>>
>> If I try a variation where the 'find' is called after all the
>> criteria have been loaded, e.g.,
>>
>> if dataList is equal to {} then
>> find
>> end if
>>
>> I get the same results, whatever was the last request criteria  
>> entered.
>>
>> What's the new approach on how to deal with multiple search requests?
>>
>> Regards,
>>
>> Chuck
>>
>

ATOM RSS1 RSS2