Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3707 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

 

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"
Posted

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.

Posted

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.

This topic is 3707 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.