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

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

Recommended Posts

  • Newbies
Posted

Hi!

The following is almost certainly a bug. I have an auto-enter calculation for a field called Family:

Family & EvaluateGroovy("fmpro.performScript(fmpro.evaluate('Get(FileName)'), 'DisplayFamily')")

With FMP 10, Mac OS X 10.6.3 and Java 1.6.0_20 this calls the script 'DisplayFamily'. It's not perfect because the following is dumped to the system console:

[0x0-0x3e03e].com.filemaker.client.advanced[961] Jun 2, 2010 8:56:22 PM com.prosc.fmkit.PluginContext evaluateExpression

[0x0-0x3e03e].com.filemaker.client.advanced[961] WARNING: evaluateExpression called from non-FileMaker thread: Thread[AWT-EventQueue-0,6,main]

[0x0-0x3e03e].com.filemaker.client.advanced[961] Jun 2, 2010 8:56:22 PM com.prosc.fmkit.PluginBridge doFunction

[0x0-0x3e03e].com.filemaker.client.advanced[961] WARNING: No result in main thread AWT-AppKit for PluginFunction{name='EvaluateGroovy', functionID=28121, minArgs=null, maxArgs=1}. All plugin functions should always return a result!!!

Under the same environment but using FMP 11, the FMP client freezes until the user changes the window focus to another application. The console output is even more worrying:

[0x0-0x40040].com.filemaker.client.advanced[1004] Jun 2, 2010 9:01:10 PM com.prosc.fmkit.PluginContext evaluateExpression

[0x0-0x40040].com.filemaker.client.advanced[1004] WARNING: evaluateExpression called from non-FileMaker thread: Thread[AWT-EventQueue-0,6,main]

FileMaker Pro[1004] *** __NSAutoreleaseNoPool():) Object 0x41588b0 of class NSCFArray autoreleased with no pool in place - just leaking

FileMaker Pro[1004] *** __NSAutoreleaseNoPool()??? Object 0x1c8bc260 of class __NSCFDate autoreleased with no pool in place - just leaking

FileMaker Pro[1004] *** __NSAutoreleaseNoPool():P Object 0x35b43670 of class NSCFTimer autoreleased with no pool in place - just leaking

FileMaker Pro[1004] *** __NSAutoreleaseNoPool(): Object 0x1c880b00 of class __NSFastEnumerationEnumerator autoreleased with no pool in place - just leaking

[0x0-0x40040].com.filemaker.client.advanced[1004] Jun 2, 2010 9:33:28 PM com.prosc.fmkit.PluginBridge doFunction

[0x0-0x40040].com.filemaker.client.advanced[1004] WARNING: No result in main thread AWT-AppKit for PluginFunction{name='EvaluateGroovy', functionID=28121, minArgs=null, maxArgs=1}. All plugin functions should always return a result!!!

Is there anything obvious that I've over looked? Will this be fixed in the next release?

Posted

Two things:

It looks like you are passing "Get(FileName)" as the table name. You should be passing the table you are currently working in.

Secondly, calling the EaluateGroovy is going to give you much slower performance than registering the function will give you. I recommend calling

RegisterGroovy( "CallScriptImmediately( tableName ; scriptName ; parameter )" ; "fmpro.performScript(tableName, scriptName, parameter);¶

return true;" )

To register the function in your startup script, and then you will be able to call CallScriptImmediately( tableName; scriptName; parameter) just like you would call any other calculation in a calculation in filemaker. This will improve your performance, stability, and allow you to use filemaker calculations more easily inside the functions.

  • Newbies
Posted

David,

Thanks for the quick reply!

Firstly with respect to the fmpro.perfomScript(:), scriptName, parameter), I'm confident that the first parameter is the filename where the script is located and not a table. This is stated in the documentation.html file which is bundled with the plugin:

"performScript(fileName, scriptName [ , paramString ])

Performs a FileMaker script in the current file, passing in the optional paramString as a parameter. Note: fileName is required."

To further prove the point, you only have to rename the file ScriptMaster.fp7 and run the "Call Script Immediately" example module to see that the fmpro object needs the filename. I've been using performScript for over two years this way without problems.

Point taken about the efficiency and stability of registering the functions. However, we still have the same problem - FMP Advanced 11 (Mac) freezes when using performScript until the window focus is changed. I have some further information. This only seems to happen when perfomScript is called in the auto-enter calculation of fields (even when wrapped in a registered function).

With the introduction of FMP 10, we could achieve similar functionality using the layout script triggers, but using ScriptMaster allows us to create calculations that can directly call different scripts depending on the contents of the fields in question.

Any help you can provide would be greatly appreciated.

Regards,

Kevin

Posted

Does it work if you register the function and then call it directly, rather than using the evaluate groovy function?

  • Newbies
Posted

I tested it in a registered function, which was called from the auto-enter calculation. It still causes the FMP 11 freeze until I change window focus. The only difference is that there are less error messages in the console:

__NSAutoreleaseNoPool():) Object 0x41588b0 of class NSCFArray autoreleased with no pool in place - just leaking

__NSAutoreleaseNoPool(): Object 0x1c8bc260 of class __NSCFDate autoreleased with no pool in place - just leaking

__NSAutoreleaseNoPool(): Object 0x35b43670 of class NSCFTimer autoreleased with no pool in place - just leaking

__NSAutoreleaseNoPool(): Object 0x1c880b00 of class __NSFastEnumerationEnumerator autoreleased with no pool in place - just leaking

Is ScriptMaster multithreaded? These are the types of error I would expect to see if Cocoa code is not thread safe and one thread is trying to release an object initiated in another thread. Speculation on my part..

  • 3 weeks later...
Posted

Hi kpalser, thank you for reporting this problem. I have fixed this problem, it will be in the next ScriptMaster release.

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