April 12, 200619 yr Newbies I am having problems retrieving values from a table unless I am displaying a layout in FileMaker containing the fields (or table - I am not sure which...) For example, when I have a table containing the following records: Table: Manuals ManualID ManualName Language 0001 First manual EN 0002 Second manual EN 0003 First manual DE 0004 Second manual DE and I want to get every manual with Language="EN", I use the following AppleScript to get the IDs (not the ManualID) of those records: --Get a reference to the table I am using tell application "FileMaker Pro" to set manualTable to (first table where name is "Manuals") as reference set theLanguage to "EN" -- Get every manual with the set language tell application "FileMaker Pro" set theManuals to (ID of every record of manualTable where (cell "Language" = theLanguage)) as list end tell This script usually works fine, but if I change "theLanguage" to "DE", the variable "theManuals" is usually undefined/empty unless the layout "Manuals" (containing all fields in the table "Manuals") happens to be displayed in FileMaker. I can fix this by adding the line "show layout "Manuals"" before retrieving the records, but I thought that by accessing the tables directly it would be unneccessary to involve flipping layouts and windows in FileMaker when accessing the databases. Any pointers to where I am screwing things up would be appreciated.
April 12, 200619 yr I'm not an AppleScript guru, but the mistakes I typically make with it have to do with context/scope. Are you missing an "end tell" after the set theLanguage step, or did you snip out some code?
Create an account or sign in to comment