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

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

Recommended Posts

Posted

Hello

I am struggling with an annoying issue, using the excellent ScriptMaster by 360 Works.

I try to define a function called $$sendHTML in the startscript of my database with RegisterGroovy( "SendEmailWithAuthentication( from ; to ; subject ; htmlBody ; attachmentPath ; smtpHost ; username ; password )" ; "import javax.mail.*;¶.... If the demo database from 360 Works has been opened, it works. If not, no chance. $$sendHTML returns a ?

What did I forget?

Thank you for your advice

Posted (edited)

The easies way to do this is t use the scriptmaster.fp7 file to get the function you need for your database.

1. Find and select the scriptmaster module you would like to use from the list in the scriptmaster file.

2. Click "register function" on the module's layout. You will be taken to a new layout with code on it.

3. Copy and paste the code from the bottom of the new layout into the calculation for a Set Variable script step in your startup script for your file.

I believe that the Send Email With Authentication module also requires that you import a .jar file, so you will need to copy the mail.jar file from the scriptmaster Jar Libraries into a container in your own database, and then call SMLoadJar (container with mail.jar in it) in a set variable script step before the set variable step which registers the Send Mail module.

You will have to add two script steps to your opening file:

Set Variable: $loadjar - SMLoadJar(yourjarfile::containerfield)

Set Variable: $register - calculation_copied_from_scriptmaster_file

Edited by Guest
Posted

Yes, those script steps that i listed for you are what you need to do in order to not need to use the scriptmaster.fp7 file.

  • 3 weeks later...
Posted

thank you, but I had no chance yet.

in the step, and that's the only call to the 360 works script, I do (i'm using a german os), i defined as follows (see screenshot)

screenshot.png

Posted

It looks like you have modified the function and replaced some of the variable names in the function with fields from your database. Simply copy-and paste the code from the screen where it is presented to you. Modifying the function will cause it to perform differently or incorrectly.

You will enter the fields from your database when you call the function in a filemaker calculation, not when you are registering the function.

Posted

There are two jars that are needed for emailing: activation.jar and mail.jar. It looks like you are only loading one of them.

Posted

great, thank you!

but I need the external function SMLoadJar(...) for this to work, and my only possibility is to link to the ScriptMaster File, right?

cheers

Posted

You can export the jar files that you need from the ScriptMaster.fp7 file (they're regular container fields), and then import them into your own solution and use SMLoadJars with the files in your solution.

Posted

I have the two jars in container fields (copy and paste), but I do not have the external function SMLoadJar if I don't open ScriptMaster.

I'm quite sure that I misunderstand something, but cannot figure it out... :

Posted

SMLoadJar is just an external function in your function list, which will appear when the scriptmaster plugin is installed. You use it in the first script step of the script you posted. You will need to call that function twice to load the two different jars needed for this module.

You will be able to successfully call the SMRegister function after these two SMLoadJar functions have been called.

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