![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a script that reads a text field, the performs an Applescript to process the information and use ti to set a couple of other fields. It runs fine as an Applescript ij Script Editor using "Tell application Filemaker Pro." But when fired with a script trigger on exit from the source field I get error messages "Data is being accessed by another user, script...etc." when it tries to set the other cells. That error usually comes up when the record is not committed, but the onExit trigger only works after you have clicked out of the field. So what is it complaining about? |
#3
| |||
| |||
|
|
On 1/17/2011 3:20 PM, Bill Steele wrote: I have a script that reads a text field, the performs an Applescript to process the information and use ti to set a couple of other fields. *It runs fine as an Applescript ij Script Editor using "Tell application Filemaker Pro." But when fired with a script trigger on exit from the source field I get error messages "Data is being accessed by another user, script...etc." when it tries to set the other cells. That error usually comes up when the record is not committed, but the onExit trigger only works after you have clicked out of the field. So what is it complaining about? Try using two triggers. First trigger onmodify to grab the field value |
|
It's complaining because Applescript accesses the database as an external query/command. *It cannot make changes to a record that FileMaker already has open/locked. Is there a reason you are using an external tool like Applescript rather than FileMaker's own Scriptmaker? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Howard Schlossberg FM Professional Solutions, Inc. * *Los Angeles FileMaker Certified Developer Associate Member, FileMaker Business Alliance |
#4
| |||
| |||
|
|
On Jan 17, 11:53*pm, Howard Schlossberg how... (AT) nospam (DOT) fmprosolutions.com> wrote: On 1/17/2011 3:20 PM, Bill Steele wrote: I have a script that reads a text field, the performs an Applescript to process the information and use ti to set a couple of other fields. *It runs fine as an Applescript ij Script Editor using "Tell application Filemaker Pro." But when fired with a script trigger on exit from the source field I get error messages "Data is being accessed by another user, script...etc." when it tries to set the other cells. That error usually comes up when the record is not committed, but the onExit trigger only works after you have clicked out of the field. So what is it complaining about? Try using two triggers. First trigger onmodify to grab the field value in a global variable. Then second trigger on save runs your script and uses the global variable. Don't forget to clear the global variable when done with it. |
| It's complaining because Applescript accesses the database as an external query/command. *It cannot make changes to a record that FileMaker already has open/locked. Is there a reason you are using an external tool like Applescript rather than FileMaker's own Scriptmaker? |
#5
| |||
| |||
|
|
Lots of things Applescript can do that Scriptmaker never dreamed of. In this case, a lookup from a list. |
#6
| |||
| |||
|
|
On 1/18/2011 10:14 AM, Bill Steele wrote: Lots of things Applescript can do that Scriptmaker never dreamed of. In this case, a lookup from a list. While the first part of that statement may or may not be true, I'd like you to elaborate on the second part of your statement please. Please provide an example of looking up from a list. Is the list represented by records? What is the list format and how many values in the list? I'd bet there's a custom function or other calc that could do what you want. |
)
#7
| |||
| |||
|
|
"Howard Schlossberg" <howard (AT) nospam (DOT) fmprosolutions.com> wrote in message news:ih4rg9$dr9$1 (AT) news (DOT) motzarella.org... On 1/18/2011 10:14 AM, Bill Steele wrote: Lots of things Applescript can do that Scriptmaker never dreamed of. In this case, a lookup from a list. While the first part of that statement may or may not be true, I'd like you to elaborate on the second part of your statement please. Please provide an example of looking up from a list. Is the list represented by records? What is the list format and how many values in the list? I'd bet there's a custom function or other calc that could do what you want. Even just a simple Relationship can be used to lookup from a list easily enough. Helpful Harry ) |
#8
| |||
| |||
|
|
User types in "February." I want 2. Filemaker has a function to get a month name from a date, but nothing that goes the other way. Yes, I thought of creating table that just has the names and numbers, but that seems like overkill. And I already had the Applescript code lying around. I may just tell people "Shut up and type in the date the other way." |
)
)
#9
| |||
| |||
|
|
User types in "February." I want 2. Filemaker has a function to get a month name from a date, but nothing that goes the other way. Yes, I thought of creating table that just has the names and numbers, but that seems like overkill. And I already had the Applescript code lying around. I may just tell people "Shut up and type in the date the other way." |
#10
| |||
| |||
|
|
On 2011-01-19 11:58:13 -0800, Bill Steele <ws21 (AT) cornell (DOT) edu> said: User types in "February." I want 2. Filemaker has a function to get a month name from a date, but nothing that goes the other way. Yes, I thought of creating table that just has the names and numbers, but that seems like overkill. And I already had the Applescript code lying around. I may just tell people "Shut up and type in the date the other way." So what you do is create a date, and then enclose that in the MonthName function like so: MonthName ( Date(UserInput; 1; 2000)) Very simple, elegant and no need to be grubbing about in AS. The year doesn't matter, since all years have the same months, and the day doesn't matter, as long as it's in every month. Never mind brute force tests. Explore your functions. They're all listed in the Help with syntax and examples. |
![]() |
| Thread Tools | |
| Display Modes | |
| |