Re: Finding a list of things in FMPro
Re: Finding a list of things in FMPro
- Subject: Re: Finding a list of things in FMPro
- From: Nigel Smith <email@hidden>
- Date: Thu, 22 Jan 2004 13:24:24 +0000
On 21/1/04 21:05, "Andrew Oliver" <email@hidden> wrote:
>
You seem to be going about this in a very longwinded way.
Perhaps because the short-winded ways I try never work? :-)
>
The following code snippet will find all records whose cell 'fruit' contains
>
either 'Apple' or 'Pear':
>
>
tell application "FileMaker Pro"
>
set cell "fruit" of request 1 to "Apple"
>
set cell "fruit" of request 2 to "Pear"
>
find
>
end tell
"FileMaker Pro got an error: object not found"
This on both FileMaker 4.1 and FileMaker 5.5v2
The first request is fine, but going for a second always fails.
OK, I think I've got it working in 5.5, bu referring to the DB by name.
Version 4 still doesn't work -- but this does:
tell application "FileMaker Pro"
set cell "fruit" of request 1 to "Apple"
create request
set cell "fruit" of request 2 to "Pear"
find
end tell
So, to find all the items in the variable-length list "theList":
--for either version of FMP
tell application "FileMaker Pro"
tell database "fruittest"
delete every request
repeat with eachItem in theList
set currReq to create request at database "fruittest"
set cell "fruit" of currReq to contents of eachItem
end repeat
find
end tell
end tell
--
Easier to read, certainly. About 10% faster than my previous version *if*
the time taken creating the search string is included. If the
string-mangling to create the search term is not counted, mine is 30%
faster.
Unfortunately, I can't get it to work when run as a ScriptMaker step within
FMPro 4 -- problems referencing the correct database to create the requests
in, or one DB being left "paused" during the script -- so I shall be using
my version for that job.
Thanks, Andrew!
Nigel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.