Re: Deleting records from Filemaker (continued)
Re: Deleting records from Filemaker (continued)
- Subject: Re: Deleting records from Filemaker (continued)
- From: David Simerly <email@hidden>
- Date: Fri, 21 Sep 2001 15:40:30 -0700
- Url: http://www.digital-native.com
on 9/21/01 2:34 PM, Mike Tuller at <email@hidden> wrote:
>
The problem with this way of doing it, if there isn't a record that equals
>
something I have in the script, the script is stopped because the object is
>
not found. I assume that you would create an if statement. What would be the
>
correct syntax for this statement. Also, is this the best way to do this
>
type of deleting? I have a lot of records that I want to delete, so if the
>
is a more efficient way, let me know.
There's a couple ways to do it. I think using the if statement approach you
mention above would be the most difficult because you would first have to
show all the records that match the criteria, then check to see whether the
found set contains any records, and finally do the delete. I believe the
easier approach would be to nest the deletes in try/end try blocks which
would trap the "not found" error and let the script continue on its merry
way. Your script might look something like this:
tell application "FileMaker Pro"
activate
try
delete (every record whose (cell "Software" is "Apple Applet
Runner"))
end try
try
delete (every record whose (cell "Software" is "Keychain
Scripting"))
end try
......etc.
HTH.
DS
______________________________________
Digital Native
Your guide through the virtual jungle.
______________________________________
"Everyone is a genius at least once a year." -- Georg Christoph Lichtenberg,
scientist and philosopher (1742-1799)