Hi all,
I have a script that export a lot of information (Estimated costs Bid) from FileMaker 8 to InDesign CS2 and it’s working ok, but yesterday I discover a little bug, and I didn’t found a way to resolve it:
The script uses information about the gender of the destined person of the letter to write appropriate salutation in Spanish (Estimada or Estimado), but in many cases the Data Base don’t have this filed filled, so the script ask for the gender, so it can use the adequate word and in the background fill this data in the appropriate table in FM. This is done now, using info of a cell that gives to each person a unique number “ClaveContacto”, so when necessary, go in the background and fill the cell “Sexo”, but assuming that this unique number is also the number of the record, but I never stopped to think that the user can delete records, (Daah!) so at this point the “ClaveContacto” will never coincide with the record number and of course I receive an Error, “Object not found”.
My actual script looks like this and this process are doing without interruption of my principal script:
tell application "FileMaker Pro Advanced"
tell database "DKontrolData"
tell table "Directorio"
set cell "a10 Sexo" of record (ClaveContacto as integer) to SexoD
end tell
end tell
end tell
So I try to rewrite my code with something like:
"set cell "a10 Sexo" of (record whose cell Clave Contacto is ClaveContacto) to SexoD
This code doesn’t work at all, and I don’t found any way to do this.
As I understand in FM the only 2 ways to found anything is using “Show” or “Make a new request” but this commands will interrupt my process in InDesign, and this is not desirable, so anybody knows a way to do that?
The other way I tried to solve this issue is by using the Record ID of the appropriate record, so in the data base I put a new filed “RecordID” and defined it’s value using the FileMaker Function “Get (RecordID)”, but FM gives me a very different value from the one that I see in the Explorer of Script Debugger, for example Script Debugger show an ID like “3.3393E+4” and FM gives “754” and if I try to use this last value, I get the same Error "Object Not Found’ but I can’t see any way to get this ID within FileMaker
I know this last question isn’t exactly AS, but is related.
In the Hanaan Rosenthal’s book page 43 is an example that tell:
tell application FileMaker Pro"
Tell table "guests" of database "party"
Set kids_list to cell "name" of every record whose cell "age" is less than 12
End tell
End tell
I try this using exactly the same code “of course using my variables, table & database names“ and I also get same error “Object not found”
Can anyone give a tip about how to set some data in a table using the whose clause or similar?
Thanks in advance
Carlos Ysunza