Is there a way to set a variable to a specific Filemaker Pro field? (the get data command retrieves a list of all the data from the specified field in all the found records.)
I know I can work around this by placing making a FileMaker script to copy the field and activating the script with the do script command. This would put the contents of the field onto the clipboard which could then be pasted somewhere else; but that makes cancatanations difficult. It seems that there should be a way to do something like:
set myVariable to [the Filemaker file, record, and field]
I remember banging my head trying to script FileMaker.
Here are a couple of other hopefully helful hints to scripting
the population of FileMaker records.
tell application "FileMaker Pro"
--it's helpful to set a variable to refer to which database you are addressing
--especially if you have multiple DB's open.
set myDataBase to a reference to database "rehearsal.fp5"
--if you want to set some cell of the current record do this
set myCurrRec to the current record of myDataBase
set cell "Who" of myCurrRec to "some data"
--if you want to set some cell of a newly created record do this
set myNewRec to create new record in myDataBase
set cell "Who" of myNewRec to "some data"
(*or if you have all the data for a new record you could
go to a layout where all of your fields are in the same order as
your list and just create the new record with the data automatically in it
this is one of the quickest ways I know of to fill a FileMaker record
via AS.*)
set myList to {"some data", "some more data", "last bit of data"}
create new record in myDataBase with data myList
end tell
The same works for getting the data in a cell/field.