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

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

Recommended Posts

Posted

While my knowledge of AppleScript is limited, how it works with Filemaker is even more so.

I'm trying to get certain values into a field and I've come across a few different ways to do it.

1 - set the cell "fieldA" of record 1 of database 1 to (varA as text)

2 - set the field "fieldA" to varA as text

3 - set the cell "fieldA" of current record to (varA as text)

They seem to do the same thing. But I've noticed that when I'm using it in a FM Script from calc field, example 1 cause the FM Script to basically skip over the AppleScript, 2 only works on my machine and not my client's, and 3 I have yet to test on my client's but work fine on mine.

Is there some official logic to all this?

Posted

Hey Chris,

1. sets the first record of the found set

2. set all records of the found set

3. sets the current record

Aint it it great?

Regards.

Ernst.

Posted

Be very careful with number 2. That could set fieldA in *all* records at once, not just in one record.

As you have noticed, there are a lot of subtle differences in how different syntaxes behave. Sometimes they behave the same way, and at other times differently. If you are calling an applescript from outside Filemaker, and the target database is not open, then "current record" won't have any meaning, and it will probably default to record 1. If you have several databases open, and don't specify a target database, then the frontmost one will be used. So, it's important to specify a database and a record.

This topic is 7774 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.