September 20, 201411 yr Hello, new here... I was hoping someone could help me with this simple application of AppleScript within FileMaker. I'm trying to grab the value of a field and have it as a variable in AppleScript set myVar to cell "Index #" This works fine. Index # is a field on current layout and while in Layout Mode its name displays exactly like this. But when I attempt to grab value of a field which in Layout Mode displays as ::Name then I get Object not found error. This field is still on the current layout but orignating from related table "Personal Data" How do I reference this related table and grab its field value?
September 20, 201411 yr How do I reference this related table and grab its field value? If you're doing this in FileMaker, then you reference the field like in any other FileMaker calculation; your AppleScript is simply a combination of static AppleScript and dynamic FileMaker field data, calculated according to FileMaker syntax: "set myVar to " & Personal Data::name & """ or a bit easier on the eye: "set myVar to cell " & Quote ( Personal Data::name ) If you want to (re-)define the variable from within an AppleScript, use tell application "FileMaker Pro" set myVar to cell "Name" of table "Personal Data" The question of course is from which record you want to grab that field value … set myVar to cell "cLocation" of record 2 of table "PTO__StockTransactions"
September 26, 201411 yr Author if I may revive the subject... I need to resort to the option where you specified what record to grab: set myVar to cell "cLocation" of record 2 of table "PTO__StockTransactions" I do not know the record number itself but what I do have is the value of another parallel field which belongs to the same record from that "PTO__StockTransactions" table. How do I combine that in AS? set myVar to cell "cLocation" of record (* whose field "referenceNo" has value "12345" *) of table "PTO__StockTransactions" *** 12345 is FileMaker automatically generated indexed number actually, not a string.
September 27, 201411 yr I do not know the record number itself but what I do have is the value of another parallel field Try set myVar to cell "desiredField" of (every record whose cell "referenceNo" = "someNumber") of table "myTable" where it seems that, if referenceNo is a number value, you can pass the search value with or without quotes.
Create an account or sign in to comment