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.

Integrate ScriptMaster Fn and Script in existant solution

Featured Replies

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

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

  • Author

Thank you very much. It works. but...

can I do this without opening and closing the database "ScriptMaster" ?

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

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

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.

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

  • Author

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

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.

  • Author

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

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.

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.