Jump to content
Server Maintenance This Week. ×

ActiveXProxy


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

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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