Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

EvaluateGroovy( "

	import org.codehaus.groovy.scriptom.ActiveXProxy;

	//import java.io.File;

	

	def word = new ActiveXProxy("Word.Application");

	

	word.Documents.New;

	return word.Documents.Count;

" )

I am calling the above from a Dialog Box, the return is blank. Any ideas?

Edited by Guest

  • Author

OK... So I opened up the sample file with the scripts in it and created a new record. Then inserted:

import org.codehaus.groovy.scriptom.ActiveXProxy;

//import java.io.File;



def word = new ActiveXProxy("Word.Application");



word.Documents.New;

return word.Documents.Count;

It seems that the stumbling block is actually the import! AH!

EDIT:

http://groovy.codehaus.org/COM+Scripting

Well, I didn't read the docs from the beginning. Apparently, there is a dll and two jars. So, any help getting this thing working? Making ActiveX COM objects available to FileMaker seems like it would be incredibly veratile.

Edited by Guest

Hey James - this is a really cool idea. I don't have a Windows box set up to test this stuff, but maybe I can give you some ideas - try using the SMLoadJar function ( http://360works.com/plugins/SCRIPTMASTERPLUGIN/documentation.html#SMLoadJar ) to load the 2 jars from either a container field or from a URL. I'm not sure where to tell you to put the DLL.

  • Author

Hey James - this is a really cool idea. I don't have a Windows box set up to test this stuff, but maybe I can give you some ideas - try using the SMLoadJar function ( http://360works.com/plugins/SCRIPTMASTERPLUGIN/documentation.html#SMLoadJar ) to load the 2 jars from either a container field or from a URL. I'm not sure where to tell you to put the DLL.

I gave that a try last week... It doesn't seem to like them... I moved the code to the Example FP7 and added the JARs to containers. One of the JARs won't show up in the list to mark as being used. The other caused an error that said it couldn't load the JAR because it didn't have a Name.

  • 1 month later...

I'm not sure why you're getting that error - if you want to post your demo file here as an attachment, I'll be happy to see if I can figure out why it's not loading.

P.S. - you don't need to use the demo file that comes with ScriptMaster to load jars; you can load them from any container field in a script in your own solution.

  • Author

you don't need to use the demo file that comes with ScriptMaster to load jars; you can load them from any container field in a script in your own solution.

I started with another DB file, but it was acting strange. So, I went back to the example file. Your example file has great error notification. Anyway, I have attached the new example file. I removed all the other records and renamed it. The two JAR files are in the container table and are the last two records. (jacob.jar and scriptom-1.2.jar)

Thanks for having a look. Filemaker's DDE is just horrible and this has the potential to be far more stable.

jamesband.zip

  • Author

OK! So, I went back to basics again and decided to build ANOTHER db from scratch. This time I used path/filename for the SMLoadJar, rather than container fields, after installing groovy.

At first, this didn't work. So, I rebooted (remembering that I had allowed groovy to set some environment variables) and IT OPENED AN IE BROWSER WINDOW! : ... One time :) ...

So, then I moved the SMLoadJar lines from the execute script to it's own "Startup Script". This didn't fix anything really... Or, so I thought. I had a SMReset at the end of the execute script. Once I removed it and restarted Filemaker, it allowed me to continue to open IE browsers... However, once the SMReset is used... any future attempts break... The Word.Application script still won't run, however... :(

So, RIDDLE ME THIS:

Why can't I use the SMReset with this example?

And, when should I need t use the SMReset?

activeXproxy.zip

Edited by Guest

  • Author

OK... So I have figured out part of the problem... and it comes down to knowledge... The following is a test script that can be plugged into the DB to be executed and they do everything right except the return...

import org.codehaus.groovy.scriptom.ActiveXProxy;

import java.io.File;



def oDoc = new ActiveXProxy("Word.Application");



oDoc.Documents.Add();

oDoc.Visible=true;



return( oDoc.Documents.Count );

returns - org.codehaus.groovy.scriptom.VariantProxy@16917ee

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.