JamesBand Posted September 26, 2007 Posted September 26, 2007 (edited) 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 September 28, 2007 by Guest
JamesBand Posted September 26, 2007 Author Posted September 26, 2007 (edited) 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 September 28, 2007 by Guest
Jesse Barnum Posted October 1, 2007 Posted October 1, 2007 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.
JamesBand Posted October 2, 2007 Author Posted October 2, 2007 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.
Jesse Barnum Posted November 7, 2007 Posted November 7, 2007 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.
JamesBand Posted November 9, 2007 Author Posted November 9, 2007 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
JamesBand Posted November 9, 2007 Author Posted November 9, 2007 (edited) 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 November 9, 2007 by Guest
JamesBand Posted November 9, 2007 Author Posted November 9, 2007 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
Recommended Posts
This topic is 6234 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 accountSign in
Already have an account? Sign in here.
Sign In Now