Re: Find in Filemaker
Re: Find in Filemaker
- Subject: Re: Find in Filemaker
- From: Xandra Lee <email@hidden>
- Date: Mon, 09 May 2005 11:15:11 -0400
On 05-05-2005 11:49 AM, "Bruce Robertson" <email@hidden> wrote:
>> Still trying to find out
>>
>> 1. how one enters find mode in Filemaker 7 within Perform Applescript step.
>> (all methods I used to use in FMP5 fail- when within an embedded script)
>
>> 2. Assuming I can get there...
>> What's preventing me from setting an unstored calc while in find mode while
>> running an Applescript (Write access denied) when doing a search... (this
>> fails even in Script Debugger)
>
> You can't. It's a bug.
THANKs at least I can stop beating my head against a wall on that one...
Sure hope they fix it...
------------
2.why Find mode instead of show.. & what am I trying to do (see Orig script
below)
I Cannot seem to create syntax that would find 1 record of each of several
names.
The field "_isFirstofCourseName" is an unstored calc field which identifies
the first related record in a relationship -- this field does most of the
work when doing manual searches.
But I'm attempting here to essentially constrain the current found set, with
this field as the limiting factor (desired players names will not be hard
coded - I have an AS which will gather names all currently shown records)
HERE's some syntax testing:
tell application "FileMaker Developer"
--FOLLOWING WORKS:
show (every record of table "Scores" whose cell "Name" is ¬
"Doug" and cell "_isFirstofCourseName" is "1")
show (every record of table "Scores" whose cell "Name" is ¬
"Doug" or cell "Name" is "Lee")
(*
-- FOLLOWING EVENTS NOT HANDLED
set nameList to {"Doug", "Lee"}
show (every record of table "Scores" whose (cell "Name" is ¬
"Doug" and cell "_isFirstofCourseName" is "1") or cell "Name" is
"Lee") -- Event not Handled
show (every record of table ¬
"Scores" whose cell "Name" is in nameList and cell
"_isFirstofCourseName" is "1")
*)
-- FOLLOWING RUNS, BUT RETURNS WRONG RECORDS
-- Runs but doesn't do as expected (it ignores the last part)
show (every record of table "Scores" whose (cell "Name" is ¬
"Doug" or cell "Name" is "Lee") and cell "_isFirstofCourseName" is
"1")
show (every record of table ¬
"Scores" whose cell "_isFirstofCourseName" is "1" and (cell "Name"
is "Doug" or cell "Name" is "Lee"))
--runs but only returns Dougs and doesn't restict
show (every record of table "Scores" whose cell "Name" is ¬
"Doug" or cell "Name" is "Lee" and cell "_isFirstofCourseName" is
"1")
end tell
----------------------------
----------------------------
THIS WAS THE SCRIPT I USED without Issue in Filemaker 5.5:
I think it's the clearest way to explain what I'm trying to do:
--Finds one record for each course for CURRENTLY showing PLAYERS
--requires fields "_isFirstofCourseName", "PlayerID"
tell application "FileMaker Pro"
set x to field "PlayerID" of window 1 - global field set by applescript
set idList to union of x and x with removing duplicates -- 3rd party
OSAX
--clear the previous find requests:
go to request 1 --just a way to go to find mode
try
delete every request
end try
repeat with n from 1 to count of items in idList
create new request
set cell "PlayerID" of request n to (item n of idList)
set cell "_isFirstofCourseName" of request n to "1"
end repeat
find
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden